Forums
Nice graphics for demos - Printable Version

+- Forums (http://www.scratchpadgames.net/forums)
+-- Forum: Main Forums (http://www.scratchpadgames.net/forums/forumdisplay.php?fid=1)
+--- Forum: General Chat (http://www.scratchpadgames.net/forums/forumdisplay.php?fid=6)
+--- Thread: Nice graphics for demos (/showthread.php?tid=581)

Pages: 1 2


Nice graphics for demos - Brian Beuken - 12-12-2020

[Image: 2020-12-12-190558_1920x1080_scrot.png]
[Image: 2020-12-12-192739_1920x1080_scrot.png]
I've been looking for some nice models on line to do a tutorial on model rendering and shading, and found these lovely things Big Grin
This is just diffuse and ambient, going to add normal mapping, emissions and specularity. Might even tinker with a bit of PBR since I got the contet
I had to buy these, I don't normalluy but my own attemps are not great.

I also got some smashing lower res models also with mapping textures that will look very good when I take the demo a bit further.


[Image: 2020-12-12-200020_1920x1080_scrot.png]


[Image: 2020-12-12-185232_1920x1080_scrot.png]
[Image: 2020-12-12-174058_1920x1080_scrot.png]


RE: Nice graphics for demos - Brian Beuken - 12-13-2020

Starting to get the effect textures in now, beginning with the old favourite, emissive
without
[Image: 2020-12-13-182119_1920x1080_scrot.png]
with
[Image: 2020-12-13-182215_1920x1080_scrot.png]

Nice, especially in a big cruisier with engines and windows Big Grin

[Image: 2020-12-13-183411_1920x1080_scrot.png]

and with
[Image: 2020-12-13-183220_1920x1080_scrot.png]

Need to get my lighting maths sorted so I can work on normal maps and specularity, though I think that might end up being a problem for the frame rates, it does start to stress when the fragment shader is doing some work


RE: Nice graphics for demos - Brian Beuken - 12-14-2020

Still having a few issues with lighting, I'm not totally sure I've got the transforms done in the right place, but until I can add a proper moving camera and can visualise the light source this is the best I can do.

This is an example of vertex lighting using a moving light source going back and forward
Its a simple diffuse, specular and emmisive set of textures.
I could add normal/bump mapping to it, but on a vertex based shader thats a bit pointless.....but that is the next thing to investigate when I go to fragment shading.

I want to compare performance with this vertex based method against a fragment based method.. Vertex lighting is usually faster than fragment lighting but it does depend on how many pixels are being drawn.

This is on a Pi4, but still using OpenGLES2.0 GLSL1.0 shaders

it is pretty Big Grin



RE: Nice graphics for demos - Brian Beuken - 12-14-2020

A few vids to show the Pi reachingits limits with this vertex lighting system



and now for a giant model, far too close Big Grin this is over 50K verts, so quite a lot of work, though its not the vert calcs that kill the fps but accessing the 3 textures to resolve the lighting



And just for comparison I ran this on the Jetson too.....oh mammma the Pi runs at 1024x768 and limps to 20-30 fps

the Jetson runs at full 1080, and initially I locked it to the display rate, so 60fps.. when I released it... it ran flat out at 400+ though thats not whats actually happening since the gpu is simply passing on some of the writes.
Impressive as hell




RE: Nice graphics for demos - Brian Beuken - 12-15-2020

Here is a very strange thing....dunno if anyone has any ideas... I noticed that the big poly demo runs at around 30fps after a bit of optimising... not bad... I can still get a bit more though.
I then noticed than when I used VNC to montor the outout visually on my PC, the frame rate....doubled.... yes doubled... thats damned odd I thought.
so I set it up to run on my pi4, via monitor and yup, around 30fps.... run VNC as well, adn....60fps.

wtf... is this some x11 madness? I'd like to get to the bottom of this..

BTW here's the Pi3b+ doing the exact same demo, the only thing I had to change was to reduce the texture size of the emission textures as it was 4096 for the Pi4, too much anyway.
resolution is a bit different its 1080p/2 (basically rendered to dispmax as half res and stretched. so 960x540) usinv VNC on this actually slowed it down a few frames, which is more what I'd expect




RE: Nice graphics for demos - Brian Beuken - 12-15-2020

and for more tests this is the Tinkerboard at 1080p, 60fps Big Grin




RE: Nice graphics for demos - Brian Beuken - 12-15-2020

for completeness, having gone to the extreme of a jetson, lets to do the most basic system I have that does have drivers, the Nano Pi M1 with Mali MP2 GPU. Not only one of the slowest systems around, but it is limited to 1 resolution which is a shame as it might do a bit better at a lower retro game res. it averages 15fps, but actually slows down after a while as it starts to overheat Big Grin to 10fps
Even so, I'm pleased it works as it shows my generic buid configuations don't need a lot of adaptation to work.




RE: Nice graphics for demos - Brian Beuken - 12-16-2020

And finally, I noticed a very small error in my maths where I was accidently using a Mat4 instead of a Mat3... you would think it would make no real difference but it did, the whole range of the light source was impacted which in turn reduced the area of the model being lit and its specularity.. I also added a starfield sky box to give things a bit of perspective it really does pop out now.

As the video states this is now going to be my at the near limit stress test, Pi3 runs just under 50fps and 1080p/2 and Pi4 at just on 60 at 1280x768 so a good place to show where small but important improvements to the render methods can push that framerate up noticably.




RE: Nice graphics for demos - Brian Beuken - 12-16-2020

I know I said finally, but since we can't go out due to the Covid Lockdown I've been tinkering with the models I bought from Turbosquid and CGTrader.. I set this project up as a test to see which models were comfortable to process and which give issues... The Pi3 and 4 can actually handle almost all of these, those it can't can have their poly counts cut or used in cut scenes.....





RE: Nice graphics for demos - Brian Beuken - 12-19-2020

ok this was dumb Big Grin it took over an hour to set up and build... and I had to reduce the resolution..

but... here it is on a Rasperry Pi zero... I do these dumb things so you don't have to.