Xonotic Forums
Any hack to avoid the limitation of 1 stage per shader? - Printable Version

+- Xonotic Forums (https://forums.xonotic.org)
+-- Forum: Creating & Contributing (https://forums.xonotic.org/forumdisplay.php?fid=10)
+--- Forum: Xonotic - Editing and Concept Art (https://forums.xonotic.org/forumdisplay.php?fid=11)
+--- Thread: Any hack to avoid the limitation of 1 stage per shader? (/showthread.php?tid=2251)



Any hack to avoid the limitation of 1 stage per shader? - HKN - 10-19-2011

As i can read in .shader files and the internet, seems like Darkplaces only render one stage each shader.

It is true?
Im modeling some mapmodels and it is important to achieve some nice looking textures.

In the meantime im assumed this limitation in my WIP's


RE: Any hack to avoid the limitation of 1 stage per shader? - Morphed - 10-19-2011

it would be easier to help you, if you would say, what are you trying achieve


RE: Any hack to avoid the limitation of 1 stage per shader? - divVerent - 10-19-2011

This limitation cannot be solved, as it is a totally different renderer. It combines all stages it understands to a single GLSL shader.

Some kinds of texture blending are supported though - which also can be abused for detail textures, if that's what you are after.


RE: Any hack to avoid the limitation of 1 stage per shader? - HKN - 10-19-2011

(10-19-2011, 06:56 AM)Morphed Wrote: it would be easier to help you, if you would say, what are you trying achieve

Its not something in particular, its only to know how far can i go with the shader scripting.

A easy solution to make 3 stages in one plane brush is... stack 3 brushes pretty close with one shader each brush Big Grin

Thanks for the answers.


RE: Any hack to avoid the limitation of 1 stage per shader? - divVerent - 10-20-2011

Yes, that often works.

Anyway: to see full capabilities of the shaders, best is to read engine source (model_shared.c).

Some details in comparison to Q3:

- DP only REALLY cares for one stage.
- Lightmap stage is ignored and only checked if it exists. It is not counted as shader stage.
- There is ONE occasion where DP uses two shader stages. Namely, when the first stage uses no blendfunc, and the second stage uses alpha blending (blendfunc blend).
- The following DP specific shader keywords exist, with no explanation here: dpshadow, dpnoshadow, dpnortlight, dpreflectcube, dpmeshcollisions, dpshaderkillifcvarzero, dpshaderkillifcvar, dpnoshaderkillifcvarzero, dpnoshaderkillifcvar, dppolygonoffset, dprefract, dpreflect, dpcamera, dpwater, dpwaterscroll, dpglossintensitymod, dprtlightambient, dpoffsetmapping
- dppolygonoffset allows arbitrary offsets, and thus can be used to stack multiple shaders on one place


RE: Any hack to avoid the limitation of 1 stage per shader? - tZork - 10-20-2011

some examples and a bit more info can be found here: http://dpwiki.slipgateconstruct.com/index.php?title=Material_creation_for_DP