Here's a patch.
Attachment:
File comment: Zipped .diff patch
ContextsAndTests.zip [2.21 KiB]
Downloaded 805 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).
Code:
<Context id="LIGHTING" link="shared.shader.xml" />
The alpha and depth testing and such is very different.
Code:
<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.
Available attributes:
depthTest="bool", turns depth test on or off
depthMode="greater" or "less" decides whether to use GL_GEQUAL or GL_LEQUAL testing mode
alphaTest="bool", turns alpha test on or off
alphaMode="greater" or "less" decides whether to use GL_GREATER or GL_LESS testing mode
alphaValue="float" the standard of measure that the test is compared against.
alphaToCoverage="bool" enables alpha to coverage
NOTE 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.