Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
cool car I didn't manage to get in the book.
#1
Photo 
this car has caused me so much pain off and on..

It was intended to be used in the book and part of a chapter on optimising and rendering transparent objects, but 2 things happened, the book got too big and the optimising chapters got droppped and this model, turned out to be a bit of a pig to render on a raspberry.. So I left it alone. It came from a free model site, Turbo squid I think and I asked the modeller if I could use it, but it had a lot of extra content in it that my renderers then just didn't know how to deal with, and I struggled to get it to show itself in its complete form, especially with the canopy.

But I popped back to it from time to time, and as I will be doing a lesson soon to my class about rendering with light and transparency, I dug it out again and made some progress at last.

[Image: coolcar.png]

Its not actually a good example of rendering yet, I'm frigging the transparency a bit by isolating the canopy shape then forcing the shader to use a blue tinge, but its coming along, its forced me to examine more of the material content for the OBJ file, and use it as part of the render rather than just abandon it for speed reasons. I'll soon have an OBJ render system that can just draw things like this without any special isolations... though performance might drop, its good to have options of quality needed.
Its one of the questions you need to ask yourself as a game coder, do I use a special shader just for this model that gives me speed, or do a I use a general shader that will draw it and every other model but with a speed penalty....questions like this need to be asked! (And in nearly every case, unless there's a memory/tech limitation on numbers of shaders, you go for the fastest option)

[Image: snapshot.png]
Going to add some normal and specular mapping next to really make it pop out.

Oh and a Rpi 3B (not a 3B+) is comfortably rendering this  model with Total Triangles 25344 Total Vertices 76032, in 60fps, with no optimisation at all, I'm going to also use it to demonstrate how render speed can be improved with shader managment, batch rendering and the old favourite of index buffers. The actual model does have far fewer vertices than that, but TinyOBJ triangulates all the faces so the triangle count bumps up quite a bit, I plan to have a look at that sometime and see what can be done to make better uses of strips and fans as well as indices. For that reason this was a good model to use even though it didn't make the book.

60fps...really neat. It managed 2 of them at that speed, 3 though. saw it drop to 40, so my aim is to get maybe 10 of these at 60 htz.. on a Pi3B
Brian Beuken
Lecturer in Game Programming at Breda University of Applied Sciences.
Author of The Fundamentals of C/C++ Game Programming: Using Target-based Development on SBC's 



Reply
#2
Looks very cool. You plan on doing a tutorial on creating this?
Reply
#3
maybe, once my students have finished getting to grips with model loading Big Grin
Brian Beuken
Lecturer in Game Programming at Breda University of Applied Sciences.
Author of The Fundamentals of C/C++ Game Programming: Using Target-based Development on SBC's 



Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)