file How does the MB rendering engine work?

  • LegoCreator768
  • LegoCreator768's Avatar Topic Author
  • Offline
  • Experienced Marbler
  • Experienced Marbler
  • Always on technology
  • Posts: 148
  • Thank you received: 19
31 May 2016 14:55 #1
I don't know if this is the right place to put this.

I am just wondering the above (in both layman's terms and in technical speaking).


I'm just interested in how games work.

Please Log in or Create an account to join the conversation.

  • HiGuy
  • HiGuy's Avatar
  • Offline
  • Lead Developer
  • Lead Developer
  • PQ Developer Emeritus
  • Posts: 1334
  • Thank you received: 605
01 Jun 2016 02:15 #2
Don't have the effort/time to do a huge writeup tonight. Here are a few things you can look into that they use. Note: this is for MBG, as MBP's custom renderer uses entirely different methods.

OpenGL for rendering, it does all the 3d graphics and stuff.
Immediate mode rendering because this version of Torque was released before shaders really caught on.
Stencil shadow volumes for shadows. Compare to shadow mapping where the shadow values are stored in textures instead of geometry.
Gouraud shading smooths the light values between the different faces so you don't get choppy spheres or loops when there are a low number of polygons.
Binary Space Partitioning for optimizing the renderer. This speeds up time to draw the scene, but takes extra time because you need to build the BSP tree (map2dif does this for difs, and the game also does this when loading).

Jeff could go into more detail on most of these, as well as the wiki pages that I linked. It gets into advanced mathematics (linear algebra and calculus, hooray!) really fast, so be warned.

This signature is real code
Code:
function clientcmd12dothepq() { commandToClient(LocalClientConnection, '34onthedancefloor'); }

Please Log in or Create an account to join the conversation.

  • LegoCreator768
  • LegoCreator768's Avatar Topic Author
  • Offline
  • Experienced Marbler
  • Experienced Marbler
  • Always on technology
  • Posts: 148
  • Thank you received: 19
01 Jun 2016 14:54 #3
That's actually all I wanted to know! Thanks for that! :)

Please Log in or Create an account to join the conversation.

  • Three
  • Three's Avatar
  • Offline
  • Lead Developer
  • Lead Developer
  • level designer
  • Posts: 468
  • Thank you received: 349
02 Jun 2016 03:54 - 02 Jun 2016 03:55 #4
I don't think that the rendering engine uses Gouraud when you have shaders enabled. HiGuy please tell me if I'm wrong.

EDIT: confirmed

HiGuy wrote: MBP's custom renderer uses entirely different methods.


Follow me on twitter at @threefolder
Last edit: 02 Jun 2016 03:55 by Three.

Please Log in or Create an account to join the conversation.

  • HiGuy
  • HiGuy's Avatar
  • Offline
  • Lead Developer
  • Lead Developer
  • PQ Developer Emeritus
  • Posts: 1334
  • Thank you received: 605
02 Jun 2016 04:46 - 02 Jun 2016 04:52 #5

Threefolder wrote: I don't think that the rendering engine uses Gouraud when you have shaders enabled.


To elaborate, MBP's shader engine uses flat shading and the Blinn-Phong reflection model for the specular highlights. When developing the shader engine with Jeff, I switched back and forth between flat / Gouraud a number of times. The problem I found with Gouraud is that most geometry in Marble Blast is really flat, and the interpolation of normals in Gouraud shading can cause graphical glitches when faces don't slope smoothly. Unfortunately, using flat shading means that curves look choppy , but they're still reasonable so I went with it in the end.

This signature is real code
Code:
function clientcmd12dothepq() { commandToClient(LocalClientConnection, '34onthedancefloor'); }
Last edit: 02 Jun 2016 04:52 by HiGuy.
The following user(s) said Thank You: Jeff

Please Log in or Create an account to join the conversation.

Moderators: Doomblah
Time to create page: 1.273 seconds
We use cookies

We use cookies on our website. Some of them are essential for the operation of the site, while others help us to improve this site and the user experience (tracking cookies). You can decide for yourself whether you want to allow cookies or not. Please note that if you reject them, you may not be able to use all the functionalities of the site.