Virtual Universe 3D Engine

Overview

Vu

Vu (Virtual Universe) is a 3D engine based on the modern programming language Go (Golang). Vu is composed of packages, detailed in GoDoc, and briefly summarized below. More getting started and background information is available on the Wiki

Sub packages

  • audio Positions and plays sounds in a 3D environment.
  • audio/al OpenAL bindings. Links the audio layer and the sound hardware.
  • device Links the application to native OS specific window and user events.
  • load Asset loaders including models, textures, audio, shaders, and bitmapped fonts.
  • math/lin Vector, matrix, quaternion, and transform linear math library.
  • physics Repositions bodies based on simulated physics.
  • render 3D drawing and graphics interface.
  • render/gl Generated OpenGL bindings. Links rendering system to graphics hardware.
  • render/gl/gen OpenGL binding generator.

Less essential, but potentially more fun packages are:

  • eg Examples that both demonstrate and validate the vu engine.
  • ai Behaviour Tree for autonomous units.
  • grid Grid based random level generators. A-star and flow field pathfinding.
  • synth Procedural generation utilities.
  • tools/sdf Signed distance field converstion utility.

Installation

Ensure you have installed Go 1.6+:

go get -u github.com/gazed/vu

Now you can build and run examples:

cd $GOPATH/src/github.com/gazed/vu/eg
go build .
./eg

Build Dependencies

  • OS X: Objective C and C compilers (clang) from Xcode command line tools.
  • Windows: C compiler (gcc) from mingw64-bit.

Runtime Dependencies

  • OpenGL version 3.3 or later.
  • OpenAL 64-bit version 2.1.

Building on Windows

  • Vu has been built and tested on Windows using gcc from mingw64-bit. Mingw64 was installed to c:/mingw64.
    • Put OpenAL on the gcc library path by copying OpenAL32.dll to c:/mingw64/x86_64-w64-mingw32/lib/OpenAL32.dll
  • 64-bit OpenAL for Windows machines is available at http://openal.org/downloads. Running the OpenAL installer results in a c:/Windows/System32/OpenAL32.dll.
  • Building with Cygwin has not been attempted. It may have special needs.

Games

  • Bampf Open source reference game.
  • Jewel of Kings A game available for purchase from MacOS, iOS, and Windows stores.

Limitations

The engine and its packages include the essentials by design. In particular:

  • Vu is programmer centric. For example, there is no 3D asset editor. A working application is used as an editor replacement. Programmers create a working application with stub 3D assets. Artists and modellers then polish and finish the application by replacing the stub assets.
  • Physics only handles boxes and spheres.
  • The device layer interface provides only the absolute minimum from the underlying windowing system. OSX, iOS, and Windows 7+ are currently supported.
  • Rendering supports standard OpenGL 3.3 and later. OpenGL extensions are not used.
  • The Windows platform is sometimes limited by the availability of OpenGL and OpenAL. Generally OpenGL issues are fixed by downloading manufacturer's graphic card drivers. However older laptops with Intel graphics don't always have OpenGL drivers.
Comments
  • Consistent Color/Colour naming

    Consistent Color/Colour naming

    Hi! awesome library thanks for the hard work so far! I just started using it but I already fell in love :-)

    But it would awesome if color would be named consistently within the library (preferably color :P).

    In vu.Eng#SetColor its SetColor but in render.Light its SetColour/GetColour().

    Thx!

    opened by sharpner 3
  • Fix broken headings in Markdown files

    Fix broken headings in Markdown files

    GitHub changed the way Markdown headings are parsed, so this change fixes it.

    See bryant1410/readmesfix for more information.

    Tackles bryant1410/readmesfix#1

    opened by bryant1410 1
  • Importing a heightmap into VU

    Importing a heightmap into VU

    Hi! How would one go about importing a heightmap into VU (something like this)? I am interested in simulating some projectile collisions with terrain. Are there other options apart from adding boxes on every position to recreate the terrain mesh?

    opened by dclipca 0
  • Run on mobile inside flutter

    Run on mobile inside flutter

    https://github.com/mogol/opengl_texture_widget_example

    I can run golang inside flutter easily. Just a matter of outputting into each android and iOS buffer.

    Are you interested in helping as might need some

    opened by ghost 0
  • Doesn't compile on OpenSuse

    Doesn't compile on OpenSuse

    # github.com/gazed/vu/device
    ../go/src/github.com/gazed/vu/device/input.go:196: undefined: controlKeyMask
    ../go/src/github.com/gazed/vu/device/input.go:197: undefined: shiftKeyMask
    ../go/src/github.com/gazed/vu/device/input.go:198: undefined: functionKeyMask
    ../go/src/github.com/gazed/vu/device/input.go:199: undefined: commandKeyMask
    ../go/src/github.com/gazed/vu/device/input.go:200: undefined: altKeyMask
    ../go/src/github.com/gazed/vu/device/input.go:208: undefined: key0
    ../go/src/github.com/gazed/vu/device/input.go:209: undefined: key1
    ../go/src/github.com/gazed/vu/device/input.go:210: undefined: key2
    ../go/src/github.com/gazed/vu/device/input.go:211: undefined: key3
    ../go/src/github.com/gazed/vu/device/input.go:212: undefined: key4
    ../go/src/github.com/gazed/vu/device/input.go:212: too many errors
    # github.com/gazed/vu/audio/al
    could not determine kind of name for C.uintptr_t
    could not determine kind of name for C.wrap_alcCaptureCloseDevice
    could not determine kind of name for C.wrap_alcCaptureSamples
    could not determine kind of name for C.wrap_alcCaptureStart
    could not determine kind of name for C.wrap_alcCaptureStop
    could not determine kind of name for C.wrap_alcCloseDevice
    could not determine kind of name for C.wrap_alcCreateContext
    could not determine kind of name for C.wrap_alcDestroyContext
    could not determine kind of name for C.wrap_alcGetContextsDevice
    could not determine kind of name for C.wrap_alcGetEnumValue
    could not determine kind of name for C.wrap_alcGetError
    could not determine kind of name for C.wrap_alcGetIntegerv
    could not determine kind of name for C.wrap_alcGetProcAddress
    could not determine kind of name for C.wrap_alcGetString
    could not determine kind of name for C.wrap_alcIsExtensionPresent
    could not determine kind of name for C.wrap_alcMakeContextCurrent
    could not determine kind of name for C.wrap_alcProcessContext
    could not determine kind of name for C.wrap_alcSuspendContext
    
    gcc errors for preamble:
    ../go/src/github.com/gazed/vu/audio/al/al.go:272:2: error: unknown type name 'uintptr_t'
     // ALC_API uintptr_t    ALC_APIENTRY wrap_alcCreateContext( uintptr_t device, const int* attrlist ) { return (uintptr_t)(*pfn_alcCreateContext)((ALCdevice *)device, attrlist); }
      ^
    ../go/src/github.com/gazed/vu/audio/al/al.go:272:59: error: unknown type name 'uintptr_t'
     // ALC_API uintptr_t    ALC_APIENTRY wrap_alcCreateContext( uintptr_t device, const int* attrlist ) { return (uintptr_t)(*pfn_alcCreateContext)((ALCdevice *)device, attrlist); }
                                                               ^
    ../go/src/github.com/gazed/vu/audio/al/al.go:273:64: error: unknown type name 'uintptr_t'
     // ALC_API ALCboolean   ALC_APIENTRY wrap_alcMakeContextCurrent( uintptr_t context ) { return (*pfn_alcMakeContextCurrent)( (ALCcontext *)context ); }
                                                                    ^
    ../go/src/github.com/gazed/vu/audio/al/al.go:274:60: error: unknown type name 'uintptr_t'
     // ALC_API void         ALC_APIENTRY wrap_alcProcessContext( uintptr_t context ) { (*pfn_alcProcessContext)( (ALCcontext *)context ); }
                                                                ^
    ../go/src/github.com/gazed/vu/audio/al/al.go:275:60: error: unknown type name 'uintptr_t'
     // ALC_API void         ALC_APIENTRY wrap_alcSuspendContext( uintptr_t context ) { (*pfn_alcSuspendContext)( (ALCcontext *)context ); }
                                                                ^
    ../go/src/github.com/gazed/vu/audio/al/al.go:276:60: error: unknown type name 'uintptr_t'
     // ALC_API void         ALC_APIENTRY wrap_alcDestroyContext( uintptr_t context ) { (*pfn_alcDestroyContext)( (ALCcontext *)context ); }
                                                                ^
    ../go/src/github.com/gazed/vu/audio/al/al.go:277:2: error: unknown type name 'uintptr_t'
     // ALC_API uintptr_t    ALC_APIENTRY wrap_alcGetCurrentContext( void ) { return (uintptr_t)(*pfn_alcGetCurrentContext)(); }
      ^
    ../go/src/github.com/gazed/vu/audio/al/al.go: In function 'wrap_alcGetCurrentContext':
    ../go/src/github.com/gazed/vu/audio/al/al.go:277:80: error: 'uintptr_t' undeclared (first use in this function)
     // ALC_API uintptr_t    ALC_APIENTRY wrap_alcGetCurrentContext( void ) { return (uintptr_t)(*pfn_alcGetCurrentContext)(); }
                                                                                    ^
    ../go/src/github.com/gazed/vu/audio/al/al.go:277:80: note: each undeclared identifier is reported only once for each function it appears in
    ../go/src/github.com/gazed/vu/audio/al/al.go: At top level:
    ../go/src/github.com/gazed/vu/audio/al/al.go:278:2: error: unknown type name 'uintptr_t'
     // ALC_API uintptr_t    ALC_APIENTRY wrap_alcGetContextsDevice( uintptr_t context ) { return (uintptr_t)(*pfn_alcGetContextsDevice)( (ALCcontext *)context ); }
      ^
    ../go/src/github.com/gazed/vu/audio/al/al.go:278:63: error: unknown type name 'uintptr_t'
     // ALC_API uintptr_t    ALC_APIENTRY wrap_alcGetContextsDevice( uintptr_t context ) { return (uintptr_t)(*pfn_alcGetContextsDevice)( (ALCcontext *)context ); }
                                                                   ^
    ../go/src/github.com/gazed/vu/audio/al/al.go:279:2: error: unknown type name 'uintptr_t'
     // ALC_API uintptr_t    ALC_APIENTRY wrap_alcOpenDevice( const char *devicename ) { return (uintptr_t)(*pfn_alcOpenDevice)( devicename ); }
      ^
    ../go/src/github.com/gazed/vu/audio/al/al.go: In function 'wrap_alcOpenDevice':
    ../go/src/github.com/gazed/vu/audio/al/al.go:279:91: error: 'uintptr_t' undeclared (first use in this function)
     // ALC_API uintptr_t    ALC_APIENTRY wrap_alcOpenDevice( const char *devicename ) { return (uintptr_t)(*pfn_alcOpenDevice)( devicename ); }
                                                                                               ^
    ../go/src/github.com/gazed/vu/audio/al/al.go: At top level:
    ../go/src/github.com/gazed/vu/audio/al/al.go:280:57: error: unknown type name 'uintptr_t'
     // ALC_API ALCboolean   ALC_APIENTRY wrap_alcCloseDevice( uintptr_t device ) { return (*pfn_alcCloseDevice)( (ALCdevice *)device ); }
                                                             ^
    ../go/src/github.com/gazed/vu/audio/al/al.go:281:54: error: unknown type name 'uintptr_t'
     // ALC_API ALCenum      ALC_APIENTRY wrap_alcGetError( uintptr_t device ) { return (*pfn_alcGetError)( (ALCdevice *)device ); }
                                                          ^
    ../go/src/github.com/gazed/vu/audio/al/al.go:282:64: error: unknown type name 'uintptr_t'
     // ALC_API ALCboolean   ALC_APIENTRY wrap_alcIsExtensionPresent( uintptr_t device, const char *extname ) { return (*pfn_alcIsExtensionPresent)( (ALCdevice *)device, extname ); }
                                                                    ^
    ../go/src/github.com/gazed/vu/audio/al/al.go:283:60: error: unknown type name 'uintptr_t'
     // ALC_API void  *      ALC_APIENTRY wrap_alcGetProcAddress( uintptr_t device, const char *funcname ) { return (*pfn_alcGetProcAddress)( (ALCdevice *)device, funcname ); }
                                                                ^
    ../go/src/github.com/gazed/vu/audio/al/al.go:284:58: error: unknown type name 'uintptr_t'
     // ALC_API ALCenum      ALC_APIENTRY wrap_alcGetEnumValue( uintptr_t device, const char *enumname ) { return (*pfn_alcGetEnumValue)( (ALCdevice *)device, enumname ); }
                                                              ^
    ../go/src/github.com/gazed/vu/audio/al/al.go:285:55: error: unknown type name 'uintptr_t'
     // ALC_API const char * ALC_APIENTRY wrap_alcGetString( uintptr_t device, int param ) { return (*pfn_alcGetString)( (ALCdevice *)device, param ); }
                                                           ^
    ../go/src/github.com/gazed/vu/audio/al/al.go:286:57: error: unknown type name 'uintptr_t'
     // ALC_API void         ALC_APIENTRY wrap_alcGetIntegerv( uintptr_t device, int param, int size, int *data ) { (*pfn_alcGetIntegerv)( (ALCdevice *)device, param, size, data ); }
                                                             ^
    ../go/src/github.com/gazed/vu/audio/al/al.go:287:2: error: unknown type name 'uintptr_t'
     // ALC_API uintptr_t    ALC_APIENTRY wrap_alcCaptureOpenDevice( const char *devicename, unsigned int frequency, int format, int buffersize ) { return (uintptr_t)(*pfn_alcCaptureOpenDevice)( devicename, frequency, format, buffersize ); }
      ^
    ../go/src/github.com/gazed/vu/audio/al/al.go: In function 'wrap_alcCaptureOpenDevice':
    ../go/src/github.com/gazed/vu/audio/al/al.go:287:150: error: 'uintptr_t' undeclared (first use in this function)
     // ALC_API uintptr_t    ALC_APIENTRY wrap_alcCaptureOpenDevice( const char *devicename, unsigned int frequency, int format, int buffersize ) { return (uintptr_t)(*pfn_alcCaptureOpenDevice)( devicename, frequency, format, buffersize ); }
                                                                                                                                                          ^
    ../go/src/github.com/gazed/vu/audio/al/al.go: At top level:
    ../go/src/github.com/gazed/vu/audio/al/al.go:288:64: error: unknown type name 'uintptr_t'
     // ALC_API ALCboolean   ALC_APIENTRY wrap_alcCaptureCloseDevice( uintptr_t device ) { return (*pfn_alcCaptureCloseDevice)( (ALCdevice *)device ); }
                                                                    ^
    ../go/src/github.com/gazed/vu/audio/al/al.go:289:58: error: unknown type name 'uintptr_t'
     // ALC_API void         ALC_APIENTRY wrap_alcCaptureStart( uintptr_t device ) { (*pfn_alcCaptureStart)( (ALCdevice *)device ); }
                                                              ^
    ../go/src/github.com/gazed/vu/audio/al/al.go:290:57: error: unknown type name 'uintptr_t'
     // ALC_API void         ALC_APIENTRY wrap_alcCaptureStop( uintptr_t device ) { (*pfn_alcCaptureStop)( (ALCdevice *)device ); }
                                                             ^
    ../go/src/github.com/gazed/vu/audio/al/al.go:291:60: error: unknown type name 'uintptr_t'
     // ALC_API void         ALC_APIENTRY wrap_alcCaptureSamples( uintptr_t device, ALCvoid *buffer, int samples ) { (*pfn_alcCaptureSamples)( (ALCdevice *)device, buffer, samples ); }
                                                                ^
    
    # github.com/gazed/vu/physics
    /tmp/go-build827693216/github.com/gazed/vu/physics/_obj/collision.o: In function `btAtan2':
    ../go/src/github.com/gazed/vu/physics/collision.c:58: undefined reference to `atan2'
    /tmp/go-build827693216/github.com/gazed/vu/physics/_obj/collision.o: In function `btSqrt':
    ../go/src/github.com/gazed/vu/physics/collision.c:59: undefined reference to `sqrt'
    ../go/src/github.com/gazed/vu/physics/collision.c:59: undefined reference to `sqrt'
    ../go/src/github.com/gazed/vu/physics/collision.c:59: undefined reference to `sqrt'
    ../go/src/github.com/gazed/vu/physics/collision.c:59: undefined reference to `sqrt'
    ../go/src/github.com/gazed/vu/physics/collision.c:59: undefined reference to `sqrt'
    /tmp/go-build827693216/github.com/gazed/vu/physics/_obj/collision.o:/home/terminal/go/src/github.com/gazed/vu/physics/collision.c:59: more undefined references to `sqrt' follow
    collect2: error: ld returned 1 exit status
    
    

    go get -u github.com/gazed/vu

    [email protected]:~/Downloads> uname -a
    Linux linux-iflx 4.4.74-18.20-default #1 SMP Fri Jun 30 19:01:19 UTC 2017 (b5079b8) x86_64 x86_64 x86_64 GNU/Linux
    [email protected]:~/Downloads> cat /etc/os-release
    NAME="openSUSE Leap"
    VERSION="42.2"
    
    opened by Whitecl4ws 1
  • Implement Direct3D Renderer

    Implement Direct3D Renderer

    There is a Direct3D9 wrapper here: https://github.com/gonutz/d3d9 Having a Direct3D renderer would make deployment on Windows easier, since Windows comes with DirectX drivers but usually has bad built-in OpenGL support and the average user usually is not inclined to or capable of updating their graphics drivers which often breaks something in a blue-screeny kind of way.

    enhancement 
    opened by gonutz 2
  • Doesn't compile on Ubuntu (linux).

    Doesn't compile on Ubuntu (linux).

    Currently the project does not compile on Ubuntu, while browsing through the code I found this:

    // FUTURE
    // Currently the most popular linux distro (ubuntu) is replacing the xserver
    // display server with Mir. An example Mir shell can be found at:
    //     http://unity.ubuntu.com/mir/demo_shell_8cpp-example.html
    // Work on the linux portion will be delayed until there is an
    // ubuntu version that fully supports Mir.
    
    // The ubuntu (linux) native layer implementation.
    // This wraps the linux windows API's (where the real work is done).
    
    // // The following block is C code and cgo directvies.
    

    You can use Qt5 to create an openGL context and this is supported under Mir. Ubuntu on the phone fully supports Mir and I have been able to get openGL contexts working under QT5 with QML and Go.

    enhancement 
    opened by Splizard 2
Owner
null
A phoenix Chain client based on the go-ethereum fork,the new PoS consensus engine is based on the VRF algorithm.

Phoenix Official Golang implementation of the Phoenix protocol. !!!The current version is for testing and developing purposes only!!! Building the sou

null 9 Aug 18, 2022
Virtual-Operating-System - Virtual Operating System Using Golang And Fyne Implemented Gallery app

Virtual Operating System Virtual Operating System Using Golang And Fyne Implemen

Arjit Kumar 0 Jan 1, 2022
Parallel Digital Universe - A decentralized identity-based social network

Parallel Digital Universe Golang implementation of PDU. What is PDU? Usage Development Contributing PDU PDU is a decentralized identity-based social n

PDU.PUB 44 Nov 20, 2022
using go search the Marvel universe characters via marvel api

go-marvel-api using go search the Marvel universe characters via marvel api Build and run tests on the local environemnt Build the project $ go build

Burak KÖSE 1 Oct 5, 2021
A full-featured regex engine in pure Go based on the .NET engine

regexp2 - full featured regular expressions for Go Regexp2 is a feature-rich RegExp engine for Go. It doesn't have constant time guarantees like the b

Doug Clark 670 Jan 9, 2023
An embeddable implementation of the Ngaro Virtual Machine for Go programs

Ngaro Go Overview This is an embeddable Go implementation of the Ngaro Virtual Machine. This repository contains the embeddable virtual machine, a rud

Denis Bernard 24 Dec 3, 2022
Pluggable, extensible virtual file system for Go

vfs Package vfs provides a pluggable, extensible, and opinionated set of file system functionality for Go across a number of file system types such as

C2FO 212 Jan 3, 2023
Create and manage Isolated Virtual Environments for Go

VenGO Create and manage Isolated Virtual Environments for Golang. Motivation Why a tool to generate and manage virtual environments in Go?. Well, some

Oscar Campos 124 Jan 6, 2023
A bytecode-based virtual machine to implement scripting/filtering support in your golang project.

eval-filter Implementation Scripting Facilities Types Built-In Functions Conditionals Loops Functions Case/Switch Use Cases Security Denial of service

Steve Kemp 92 Dec 30, 2022
Forth virtual machine in Go

forego - A Forth implementation in Go ===================================== Why? ---- For ego. This is me learning the language. Both of them. So

Vadim Vygonets 26 Sep 9, 2022
A customisable virtual machine written in Go

== About GoLightly == GoLightly is a lightweight virtual machine library implemented in Go, designed for flexibility and reuse. Traditionally popular

Eleanor McHugh 217 Nov 16, 2022
A simple virtual machine - compiler & interpreter - written in golang

go.vm Installation Build without Go Modules (Go before 1.11) Build with Go Modules (Go 1.11 or higher) Usage Opcodes Notes The compiler The interprete

Steve Kemp 262 Dec 17, 2022
Create virtual machines and run Linux-based operating systems in Go using Apple Virtualization.framework.

vz - Go binding with Apple Virtualization.framework vz provides the power of the Apple Virtualization.framework in Go.

Kei Kamikawa 332 Jan 9, 2023
Seesaw v2 is a Linux Virtual Server (LVS) based load balancing platform.

Seesaw v2 Note: This is not an official Google product. About Seesaw v2 is a Linux Virtual Server (LVS) based load balancing platform. It is capable o

Google 5.5k Jan 3, 2023
A Small Virtual Filesystem in Go

This is a virtual filesystem I'm coding to teach myself Go in a fun way. I'm documenting it with a collection of Medium posts that you can find here.

Alyson 32 Dec 11, 2022
An Experimental Wasm Virtual Machine for Gophers

gasm A minimal implementation of v1 WASM spec compatible virtual machine purely written in go. The vm can be embedded in your go program without any d

Takeshi Yoneda 2.3k Dec 31, 2022
Netmaker is a tool for creating and managing virtual networks

Netmaker is a tool for creating and managing virtual networks. The goal is to make virtual/overlay/mesh networking easy for non-networking people. It should be like clicking a button. Netmaker consists of a server, an agent, and a UI.

GRAVITL 5.8k Jan 2, 2023
A bytecode-based virtual machine to implement scripting/filtering support in your golang project.

eval-filter Implementation Scripting Facilities Types Built-In Functions Conditionals Loops Functions Case/Switch Use Cases Security Denial of service

Steve Kemp 93 Jan 8, 2023
2D virtual tabletop prototype

Mirkwood Engine ?? A prototype of a virtual tabletop written in Go 1.16 and Ebiten 2 (The gif can seems a bit laggy but the animations are smooth in r

null 19 Sep 28, 2021
Convenience of containers, security of virtual machines

Convenience of containers, security of virtual machines With firebuild, you can build and deploy secure VMs directly from Dockerfiles and Docker image

null 65 Dec 28, 2022