Page 1 of 2
Cube Renderer
Posted: Tue May 08, 2018 9:28 am
by bobbyjones
After discovering that it is now possible to make Minecraft in Love I went ahead and learned how to render cubes. I ultilized
this tutorial and
this repo to do it. It took me approximately 6 hours to do this. I commented the code for people who would like to build off of what I have. Next thing for me to learn how to do is to properly map textures.
Re: Cube Renderer
Posted: Wed May 09, 2018 4:19 am
by bobbyjones
Following the tutorial some more I was able to get model loading working. Its not the best and my image for the cube is horrible but I think it works. I plan to implement basic lighting next. If you guys see anything in the code that should be changed let me know. I'm not familiar with most of the naming conventions of the matrices and such. So if you could correct that that would be great.
Re: Cube Renderer
Posted: Wed May 09, 2018 6:16 am
by zorg
In the first love file you posted, from how the cube's edges looked, it seemed like they were hollow, or inside-out; possibly an issue with the wrong faces being hidden/culled, or something?
Re: Cube Renderer
Posted: Wed May 09, 2018 6:38 am
by bobbyjones
It's the depth buffer. It has a bug.
Re: Cube Renderer
Posted: Wed May 09, 2018 2:06 pm
by Davidobot
Thanks for this example! It really helped me understand all the depth buffer and mesh features! I messed around with the latest model renderer for a bit and added more of an FPS control manner (press tab to lock mouse and then WASD + QE to fly around)
Also - about the depth buffer bug - the demo works without showing any signs of the bug on my main PC, but on Android (11.1) it does bug out.
Re: Cube Renderer
Posted: Wed May 09, 2018 3:22 pm
by bobbyjones
Davidobot I like your camera(which is what I wanted to do but i didn't get to it) but some how it cuts the fps in half. I looked at the code and there seems to be no major edit but the fps is cut in half. Unless I'm missing something of course.
edit: I think its the egg. I believe it has more polys then the glock. BTW if you try to use your own model make sure to export with triangulation.
edit2: It is not the egg's fault. Its the msaa.
Re: Cube Renderer
Posted: Wed May 09, 2018 10:51 pm
by bobbyjones
So the third edition to the this series is simple lighting. It uses only one light emitter(not sure if the shader can be made to work with more). There are two magic "numbers" in the shader that I didn't feel like making a variable for. They effect the self emittance of the model.
Re: Cube Renderer
Posted: Sat May 19, 2018 7:55 am
by 4aiman
Re: Cube Renderer
Posted: Sun May 20, 2018 9:50 am
by bobbyjones
4aiman wrote: ↑Sat May 19, 2018 7:55 am
Depth buffer not working on your computer I think.
Re: Cube Renderer
Posted: Mon May 21, 2018 5:12 pm
by 4aiman
It seems to be the case. But why is it the case?
It's not like I don't play any games and/or have this kind of issues with every other there is.
My setup: Win 10 Pro 64bit, Palit GeeForce GT1030, video driver ver. 388.43.