Here's a patch.
File comment: Zipped .diff patch
ContextsAndTests.zip [2.21 KiB]
Downloaded 92 times
Shared contexts Explanation:
As I posted in the thread pertaining to these directly, the following is the XML usage. It has no problems with linking to a link that links to a link, but it can't handle loops at the moment (you really shouldn't be doing something that silly, but I'll add the safeguards).
<Context id="LIGHTING" link="shared.shader.xml" />
The alpha and depth testing and such is very different.
<RenderConfig ...valid render config contents />
<TestConfig alphaTest="true" alphaMode="greater" alphaValue="0.5" />
The <TestConfig /> tag is optional, and will default to DepthTest = true, DepthMode = GL_LEQUAL, AlphaTest = false, and AlphaToCoverage = false.
="bool", turns depth test on or offdepthMode
="greater" or "less" decides whether to use GL_GEQUAL or GL_LEQUAL testing modealphaTest
="bool", turns alpha test on or offalphaMode
="greater" or "less" decides whether to use GL_GREATER or GL_LESS testing modealphaValue
="float" the standard of measure that the test is compared against.alphaToCoverage
="bool" enables alpha to coverageNOTE on alphaToCoverage:
You must use Horde3D::setOption( EngineOptions::SampleCount, # ) to something greater than 0 for it to actually be used. Setting it to true won't do anything if alphaTest is enabled, the two aren't compatible.
Everything has been tested fairly thoroughly with different combinations of settings, but not thoroughly enough in practice. The To-Do list includes exact specification of test modes, using "gequal" "equal" "lequal" "greater" "less"
Open for review and discussion on both implementation and XML usage.