Hey everybody, still no solution Zakwayda is right, as much as I tested with a Blender model, I'm sure there's something wrong with my implementation. I've actually uploaded the entire engine to github. Hopefully it's not too large of a project.
I'll leave a little guide here so nobody has to guess where everything is. By the way, if you want to run the project, you can either host the client folder or if you got node installed:
$ npm install
// after dependency download
$ node server
If you're using nodejs, the game will be served at localhost:8080.
By the way, I tried drawing the scene with no mipmapping but got the following warning:
texture bound to texture unit 2 is not renderable. It maybe non-power-of-2 and have incompatible texture filtering.
Which is true, my planet texture is w > h. I tried it with mipmapping off, min and mag filters on nearest.
Guide
If you press the lockmouse button, you enter fps mode enabling you to navigate around using your mouse and arrow keys (not WASD).
CORE
- src/engine/loop.js: Game Loop. Physics and Render loops called from here
MAIN ENTRY
- src/main.js: This is where I create the planet entities, textures, meshes.
- Game.load: calls a function in src/game/loader.js and loads all objs, images, etc.
- Game.ready: (line26) is called once all assets are ready and before the game starts
UV SPHERE, RENDERING, MESH AND TEXTURE CONSTRUCTORS
- src/engine/systems/drawscene.js: (line 109) Entities are rendered here.
- src/engine/texture/texture.js: The Texture object for creating new Textures
- src/engine/data/model.js: (line 216) The UV Sphere function is located here, it's the very last static function.
- src/engine/data/mesh.js: This is the Mesh object for new Meshes
SHADER
- src/shaders/phong.frag: The only shader I'm using aside from the post processing ones. You'll notice I'm feeding vec4 color the diffuse texture map only, ignoring my lighting algorithm for now.
MATH
- src/engine/math: Here you'll find matrices, vectors and also a class for calculating normals.