Author Topic: Rendering engine stuff  (Read 10168 times)

0 Members and 1 Guest are viewing this topic.

Offline Iss Mneur

  • 210
  • TODO:
Re: Rendering engine stuff
Well, as I said: D2X-XL sorts transparent polys on the fly (no extra sorting), and that is something I would add to FS Open, too.
If what you are describing is what I think it is.  Diaspora would likely be interested in that as well (or different application of that technique), so that they don't have to assemble the botanical cruiser out of separate pieces.
"I love deadlines. I like the whooshing sound they make as they fly by." -Douglas Adams
wxLauncher 0.9.4 public beta (now with no config file editing for FRED) | wxLauncher 2.0 Request for Comments

 

Offline karx11erx

  • 27
  • D2X-XL and DLE-XP coder
    • Descent 2 & D2X-XL
Re: Rendering engine stuff
D2X-XL uses kind of a combined hash/or compression algorithm to sort polys. The sort buffer has a fixed size. When doing visibility culling, D2X-XL determines the depth of the scene. The hash value range for the current frame is then [0 .. buffer size / depth - 1]. In the next step, all polys are pushed to the renderer. Each transparent poly is sent to the sort buffer with its distance from the viewer scaled into the hash value range (Z-poly / scene depth), and that hash value used as index into the sort buffer. The sort buffer has a collision handling if a sort buffer element is already in use. D2X-XL can handle up to 250.000 transparent polys, but on a Core i7 920 @ 3.6 GHz and Sapphire HD 5870 Vapor-X more than 50.000 will slow the renderer significantly down. So those few transparent polys on that ship would be nothing. ;)

 

Offline Swifty

  • 210
  • I reject your fantasy & substitute my own
Re: Rendering engine stuff
Quote
If what you are describing is what I think it is.  Diaspora would likely be interested in that as well (or different application of that technique), so that they don't have to assemble the botanical cruiser out of separate pieces.

The described method seems like it'll only apply to effects like lasers, particles, and fireballs, not polygon meshes drawn using vertex/index buffers.

 

Offline karx11erx

  • 27
  • D2X-XL and DLE-XP coder
    • Descent 2 & D2X-XL
Re: Rendering engine stuff
How do you render complex polymodels with mixed textures in a single render buffer batch? Afaik that's not possible (unless you put all the model's details in one texture and access them via texture coordinates). Still you shouldn't just render transparent (alpha blended) faces in a single batch that are far away from each other, probably with other transparent stuff between them. At least not with the techniques I know of.
« Last Edit: April 08, 2011, 05:54:22 pm by karx11erx »

 

Offline The E

  • He's Ebeneezer Goode
  • Moderator
  • 213
  • Nothing personal, just tech support.
    • Steam
    • Twitter
Re: Rendering engine stuff
Given how FS models are done, with cockpit glass being a separate group of polies with the "glass" texture assigned, this is not an issue, I think.
If I'm just aching this can't go on
I came from chasing dreams to feel alone
There must be changes, miss to feel strong
I really need lifе to touch me
--Evergrey, Where August Mourns

 

Offline Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
Re: Rendering engine stuff
How do you render complex polymodels with mixed textures in a single render buffer batch? Afaik that's not possible (unless you put all the model's details in one texture and access them via texture coordinates). Still you shouldn't just render transparent (alpha blended) faces in a single batch that are far away from each other, probably with other transparent stuff between them. At least not with the techniques I know of.

when the models are loaded a vertex buffer is made, and a different index buffer for each texture is made, when the models are rendered it goes through each texture and draws the related index buffer (obviously using the buffers related to the current LOD and skipping empty buffers). objects are sorted back to front. transparency was never intended in the design of the graphics system, but alpha blending was enabled so some effects could be performed (cockpit glass) if the modder was willing to jump through the hoops to get it working. the assumption when drawing transparent stuff on ships is that there is not a lot of stuff between the transparent poly and the opaque surface behind it (oh, another assumption, there is an opaque surface behind all transparent textures on ships). These assumptions work well enough for 90% of the transparency effects people want in FSO, though some effects don't fair as well as others (any time you can see a transparent surface through another (like big bulky glass domes) you get problems).

freespace's geometry is all stored in BSPs so you can sort it very efficiently if you need to. this is something that has been tossed around from time to time, usually as part of the elusive materials system.
Bobboau, bringing you products that work... in theory
learn to use PCS
creator of the ProXimus Procedural Texture and Effect Generator
My latest build of PCS2, get it while it's hot!
PCS 2.0.3


DEUTERONOMY 22:11
Thou shalt not wear a garment of diverse sorts, [as] of woollen and linen together