About Monkey 2 › Forums › Monkey 2 Projects › New 3d renderer
This topic contains 7 replies, has 2 voices, and was last updated by 
 AdamStrange
 1 year, 5 months ago.
- 
		AuthorPosts
 - 
		
			
				
October 23, 2017 at 7:26 am #11296
Here’s a peek at the new 3d render I’m working on.

It uses low poly models, but is focussed on optimizing for model amount, so ‘load once use many’ is the main mantra.
The movement and waving grasses are in built into the shader, you just tell the model how much to use.You can also see the same models being used with different colors and transformations
October 24, 2017 at 2:44 am #11297Impressive.
So how much of those advanced maths do you need to know to make things like this? I stil need to poke myself into watching lessons on youtube. I am still to stuck on 2d atm.
October 24, 2017 at 5:29 am #11300The maths is not too hard. getting the opengl right is the difficult thing.
I habit tested it on windows or another mac yet… So I am expecting to do some changes just to make it all work together.Now that you’ve raised it, I just had a thought. You know your original mojo3d test with making a generated maze, that had very bad FPS at the beginning. I might have a go at your code, and use it as a test to see how this one works… I’ll report back to you
October 29, 2017 at 6:12 am #11354it’s always one step forward and two back…

There was a problem with the shaders and incoming bitmaps, so I needed to backtrack a few steps and get the multiple bitmaps working and then the actual world location systems working as well.Here you can see some base objects using different shaders:
– one just flat colors
– one uses a single bitmaps (we’ll call this light as it’s showing a red/white/light image)
– the table is showing the actual world locations in color form for debugging
– and the weird xmas looking tree is showing 3 bitmaps at onceIt’s all debug work, so it’s just a work in progress, but I’m now happy with the results.
October 29, 2017 at 12:15 pm #11358progressing quickly

Using some bitmaps for skyglobe, new normal mapping and lighting.
The general look is grey because I have applied a dark grey color to the final output!I’m quite happy with the normals now they work as I wanted. Next step will be to look at stuff like reflection…
October 29, 2017 at 2:19 pm #11359finally, a bit of bump mapping. this is NOT normal mapping, but takes a single mono input and calculates the proper bump from it.
November 5, 2017 at 7:17 am #11494Just a quick update on this.
I had some really interesting bugs when cross compiling. Mac fine. Windows BANG! After some tracking I traced it back to a slight difference in OpenGL between Mac and Windows. with a tiny bit of code change between platform, but are now working exact across both systems.
tested on 4 different machines (2 mac and 2 windows) with identical results:

This means I can now start work on some lighting ideas without worry about platforms
November 6, 2017 at 3:23 pm #11522Work ongoing nicely now.
Quick comparison of cpu usage. The old method which hammered the CPU and GPU, went up with each model displayed.
so it usually started at about 15% and then settled on 35% going up if I added lots more models (20 or 30) – it was this that caught my eye that something was amis with the code.Here is a current pic:

This is the new engine with identical code and redraw on both Windows and MacOS.
General CPU is around 3%-4%!
I can add around 800 models before CPU goes towards 20%!It is very optimised for small low poly models, so you can have loads of them, each having unique properties and shader data.
 - 
		AuthorPosts
 
You must be logged in to reply to this topic.