Proposal: new Advanced Rendering Options

Proposal: new Advanced Rendering Options

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

Post Reply
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Proposal: new Advanced Rendering Options

Post by Argh »

I'd like to propose some ideas:

Advanced Rendering currently turns on both reflections and Unit shadows. These two options should be seperate, imo. We can have five Unit shaders instead:

A. Basic rendering with glow and transparency. Neither requires "advanced" shader technology.

B. Basic reflectivity, transparency and glow. Basic reflectivity just uses a skybox cube, and doesn't render the world again from the Unit's POV. This should be compatible with all GPUs that can support the ARB extensions necessary to do reflections (i.e., practically everything nowadays).

C. Basic reflectivity, glow, transparency and shadows. A much faster alternative to the current code, with few major disadvantages.

D. Complex reflectivity with a rendering distance control, glow, and shadows.

Instead of rendering the entire world from the Unit's position to make the reflection cube, render only the world + Units that are within X distance, controllable via a parameter. Use the option B shader when re-rendering Units, so that reflected Units finally look correct without causing mirror-mirror issues.

E. The "omg I have a massive super-computer" option. Render all objects that are in DrawWorldReflection loops (Lua, CEGs, etc.) to the reflection cube if within the parameter option.

To achieve these goals... we need three basic pieces of tech:

1. The different rendering options themselves as UnitRendering choices. Mainly copy-pasta here.

2. A rendering path for the skyboxes, to create one from Spring skies and store it (or update it continually if Dynamic Skies are on) or to use a map's skybox texture, instead of rendering Units and other objects within DrawWorldReflection passes.

3. A distance cutoff for generating complex reflection cubes, so that complex reflections are no longer re-rendering the entire world. I haven't looked at that code, so I don't know how trivial that is, but probably this is the hardest single thing to implement.

Changing / cutting down the ARB shaders is pretty darn trivial, and in the case of options B-E, no changes from the current code are even required- just the data being supplied.

Lua Unit shaders, like the normalmap shader, would just use whatever reflection texture was being generated, as they do now.
User avatar
Hoi
Posts: 2917
Joined: 13 May 2008, 16:51

Re: Proposal: new Advanced Rendering Options

Post by Hoi »

Good luck coding it.
Post Reply

Return to “Engine”