Pass-level mechanism for eliminating unnecessary shader compilation defines. Closes #1567. Use this mechanism to eliminate PACKEDNORMAL define from depth & shadow pass in normalmapped techniques.

This commit is contained in:
Lasse Öörni 2016-09-09 00:27:37 +03:00
parent 4e5f83acc9
commit 6895a512af
34 changed files with 132 additions and 51 deletions

View File

@ -1284,6 +1284,7 @@ A technique definition looks like this:
<technique vs="VertexShaderName" ps="PixelShaderName" vsdefines="DEFINE1 DEFINE2" psdefines="DEFINE3 DEFINE4" desktop="false|true" >
<pass name="base|litbase|light|alpha|litalpha|postopaque|refract|postalpha|prepass|material|deferred|depth|shadow" desktop="false|true" >
vs="VertexShaderName" ps="PixelShaderName" vsdefines="DEFINE1 DEFINE2" psdefines="DEFINE3 DEFINE4"
vsexcludes="EXCLUDE1 EXCLUDE2" psexcludes="EXCLUDE3 EXCLUDE4"
lighting="unlit|pervertex|perpixel"
blend="replace|add|multiply|alpha|addalpha|premulalpha|invdestalpha|subtract|subtractalpha"
[cull="cw|ccw|none"]
@ -1302,6 +1303,8 @@ Shaders are referred to by giving the name of a shader without path and file ext
Shaders and their compilation defines can be specified on both the technique and pass level. If a pass does not override the default shaders specified on the technique level, it still can specify additional compilation defines to be used. However, if a pass overrides the shaders, then the technique-level defines are not used.
As a material can set further shader defines, which would be applied to all passes, the "vsexcludes" and "psexcludes" mechanism allows per-pass control to prevent them from being included. This is intended for eliminating the compilation of unnecessary shader variations, for example a shadow shader attempting to read a normal map.
The technique definition does not need to enumerate shaders used for different geometry types (non-skinned, skinned, instanced, billboard) and different per-vertex and per-pixel light combinations. Instead the engine will add certain hardcoded compilation defines for these. See \ref Shaders "Shaders" for details.
The purposes of the different passes are:

View File

@ -906,6 +906,10 @@ static void RegisterMaterial(asIScriptEngine* engine)
engine->RegisterObjectMethod("Pass", "const String& get_vertexShaderDefines() const", asMETHOD(Pass, GetVertexShaderDefines), asCALL_THISCALL);
engine->RegisterObjectMethod("Pass", "void set_pixelShaderDefines(const String&in)", asMETHOD(Pass, SetPixelShaderDefines), asCALL_THISCALL);
engine->RegisterObjectMethod("Pass", "const String& get_pixelShaderDefines() const", asMETHOD(Pass, GetPixelShaderDefines), asCALL_THISCALL);
engine->RegisterObjectMethod("Pass", "void set_vertexShaderDefineExcludes(const String&in)", asMETHOD(Pass, SetVertexShaderDefineExcludes), asCALL_THISCALL);
engine->RegisterObjectMethod("Pass", "const String& get_vertexShaderDefineExcludes() const", asMETHOD(Pass, GetVertexShaderDefineExcludes), asCALL_THISCALL);
engine->RegisterObjectMethod("Pass", "void set_pixelShaderDefineExcludes(const String&in)", asMETHOD(Pass, SetPixelShaderDefineExcludes), asCALL_THISCALL);
engine->RegisterObjectMethod("Pass", "const String& get_pixelShaderDefineExcludes() const", asMETHOD(Pass, GetPixelShaderDefineExcludes), asCALL_THISCALL);
RegisterResource<Technique>(engine, "Technique");
engine->RegisterObjectMethod("Technique", "Pass@+ CreatePass(const String&in)", asMETHOD(Technique, CreatePass), asCALL_THISCALL);

View File

@ -136,9 +136,9 @@ public:
void SetNumTechniques(unsigned num);
/// Set technique.
void SetTechnique(unsigned index, Technique* tech, unsigned qualityLevel = 0, float lodDistance = 0.0f);
/// Set additional vertex shader defines. Causes the technique(s) to be cloned in case they weren't already.
/// Set additional vertex shader defines. Separate multiple defines with spaces. Setting defines at the material level causes technique(s) to be cloned as necessary.
void SetVertexShaderDefines(const String& defines);
/// Set additional pixel shader defines. Causes the technique(s) to be cloned in case they weren't already.
/// Set additional pixel shader defines. Separate multiple defines with spaces. Setting defines at the material level causes technique(s) to be cloned as necessary.
void SetPixelShaderDefines(const String& defines);
/// Set shader parameter.
void SetShaderParameter(const String& name, const Variant& value);

View File

@ -1665,6 +1665,9 @@ void Renderer::LoadPassShaders(Pass* pass)
extraShaderDefines = " VSM_SHADOW ";
}
String vsDefines = pass->GetEffectiveVertexShaderDefines();
String psDefines = pass->GetEffectivePixelShaderDefines();
if (pass->GetLightingMode() == LIGHTING_PERPIXEL)
{
// Load forward pixel lit variations
@ -1677,7 +1680,7 @@ void Renderer::LoadPassShaders(Pass* pass)
unsigned l = j % MAX_LIGHT_VS_VARIATIONS;
vertexShaders[j] = graphics_->GetShader(VS, pass->GetVertexShader(),
pass->GetVertexShaderDefines() + extraShaderDefines + lightVSVariations[l] + geometryVSVariations[g]);
vsDefines + extraShaderDefines + lightVSVariations[l] + geometryVSVariations[g]);
}
for (unsigned j = 0; j < MAX_LIGHT_PS_VARIATIONS * 2; ++j)
{
@ -1687,12 +1690,12 @@ void Renderer::LoadPassShaders(Pass* pass)
if (l & LPS_SHADOW)
{
pixelShaders[j] = graphics_->GetShader(PS, pass->GetPixelShader(),
pass->GetPixelShaderDefines() + extraShaderDefines + lightPSVariations[l] + GetShadowVariations() +
psDefines + extraShaderDefines + lightPSVariations[l] + GetShadowVariations() +
heightFogVariations[h]);
}
else
pixelShaders[j] = graphics_->GetShader(PS, pass->GetPixelShader(),
pass->GetPixelShaderDefines() + extraShaderDefines + lightPSVariations[l] + heightFogVariations[h]);
psDefines + extraShaderDefines + lightPSVariations[l] + heightFogVariations[h]);
}
}
else
@ -1706,7 +1709,7 @@ void Renderer::LoadPassShaders(Pass* pass)
unsigned g = j / MAX_VERTEXLIGHT_VS_VARIATIONS;
unsigned l = j % MAX_VERTEXLIGHT_VS_VARIATIONS;
vertexShaders[j] = graphics_->GetShader(VS, pass->GetVertexShader(),
pass->GetVertexShaderDefines() + extraShaderDefines + vertexLightVSVariations[l] + geometryVSVariations[g]);
vsDefines + extraShaderDefines + vertexLightVSVariations[l] + geometryVSVariations[g]);
}
}
else
@ -1715,7 +1718,7 @@ void Renderer::LoadPassShaders(Pass* pass)
for (unsigned j = 0; j < MAX_GEOMETRYTYPES; ++j)
{
vertexShaders[j] = graphics_->GetShader(VS, pass->GetVertexShader(),
pass->GetVertexShaderDefines() + extraShaderDefines + geometryVSVariations[j]);
vsDefines + extraShaderDefines + geometryVSVariations[j]);
}
}
@ -1723,7 +1726,7 @@ void Renderer::LoadPassShaders(Pass* pass)
for (unsigned j = 0; j < 2; ++j)
{
pixelShaders[j] =
graphics_->GetShader(PS, pass->GetPixelShader(), pass->GetPixelShaderDefines() + extraShaderDefines + heightFogVariations[j]);
graphics_->GetShader(PS, pass->GetPixelShader(), psDefines + extraShaderDefines + heightFogVariations[j]);
}
}

View File

@ -48,9 +48,9 @@ public:
/// Finish resource loading. Always called from the main thread. Return true if successful.
virtual bool EndLoad();
/// Return a variation with defines.
/// Return a variation with defines. Separate multiple defines with spaces.
ShaderVariation* GetVariation(ShaderType type, const String& defines);
/// Return a variation with defines.
/// Return a variation with defines. Separate multiple defines with spaces.
ShaderVariation* GetVariation(ShaderType type, const char* defines);
/// Return either vertex or pixel shader source code.

View File

@ -151,6 +151,18 @@ void Pass::SetPixelShaderDefines(const String& defines)
ReleaseShaders();
}
void Pass::SetVertexShaderDefineExcludes(const String& excludes)
{
vertexShaderDefineExcludes_ = excludes;
ReleaseShaders();
}
void Pass::SetPixelShaderDefineExcludes(const String& excludes)
{
pixelShaderDefineExcludes_ = excludes;
ReleaseShaders();
}
void Pass::ReleaseShaders()
{
vertexShaders_.Clear();
@ -162,6 +174,34 @@ void Pass::MarkShadersLoaded(unsigned frameNumber)
shadersLoadedFrameNumber_ = frameNumber;
}
String Pass::GetEffectiveVertexShaderDefines() const
{
// Prefer to return just the original defines if possible
if (vertexShaderDefineExcludes_.Empty())
return vertexShaderDefines_;
Vector<String> vsDefines = vertexShaderDefines_.Split(' ');
Vector<String> vsExcludes = vertexShaderDefineExcludes_.Split(' ');
for (unsigned i = 0; i < vsExcludes.Size(); ++i)
vsDefines.Remove(vsExcludes[i]);
return String::Joined(vsDefines, " ");
}
String Pass::GetEffectivePixelShaderDefines() const
{
// Prefer to return just the original defines if possible
if (pixelShaderDefineExcludes_.Empty())
return pixelShaderDefines_;
Vector<String> psDefines = pixelShaderDefines_.Split(' ');
Vector<String> psExcludes = pixelShaderDefineExcludes_.Split(' ');
for (unsigned i = 0; i < psExcludes.Size(); ++i)
psDefines.Remove(psExcludes[i]);
return String::Joined(psDefines, " ");
}
unsigned Technique::basePassIndex = 0;
unsigned Technique::alphaPassIndex = 0;
unsigned Technique::materialPassIndex = 0;
@ -170,6 +210,7 @@ unsigned Technique::lightPassIndex = 0;
unsigned Technique::litBasePassIndex = 0;
unsigned Technique::litAlphaPassIndex = 0;
unsigned Technique::shadowPassIndex = 0;
HashMap<String, unsigned> Technique::passIndices;
Technique::Technique(Context* context) :
@ -249,6 +290,9 @@ bool Technique::BeginLoad(Deserializer& source)
newPass->SetPixelShaderDefines(globalPSDefines + passElem.GetAttribute("psdefines"));
}
newPass->SetVertexShaderDefineExcludes(passElem.GetAttribute("vsexcludes"));
newPass->SetPixelShaderDefineExcludes(passElem.GetAttribute("psexcludes"));
if (passElem.HasAttribute("lighting"))
{
String lighting = passElem.GetAttributeLower("lighting");
@ -327,6 +371,8 @@ SharedPtr<Technique> Technique::Clone(const String& cloneName) const
newPass->SetPixelShader(srcPass->GetPixelShader());
newPass->SetVertexShaderDefines(srcPass->GetVertexShaderDefines());
newPass->SetPixelShaderDefines(srcPass->GetPixelShaderDefines());
newPass->SetVertexShaderDefineExcludes(srcPass->GetVertexShaderDefineExcludes());
newPass->SetPixelShaderDefineExcludes(srcPass->GetPixelShaderDefineExcludes());
}
return ret;

View File

@ -63,10 +63,14 @@ public:
void SetVertexShader(const String& name);
/// Set pixel shader name.
void SetPixelShader(const String& name);
/// Set vertex shader defines.
/// Set vertex shader defines. Separate multiple defines with spaces.
void SetVertexShaderDefines(const String& defines);
/// Set pixel shader defines.
/// Set pixel shader defines. Separate multiple defines with spaces.
void SetPixelShaderDefines(const String& defines);
/// Set vertex shader define excludes. Use to mark defines that the shader code will not recognize, to prevent compiling redundant shader variations.
void SetVertexShaderDefineExcludes(const String& excludes);
/// Set pixel shader define excludes. Use to mark defines that the shader code will not recognize, to prevent compiling redundant shader variations.
void SetPixelShaderDefineExcludes(const String& excludes);
/// Reset shader pointers.
void ReleaseShaders();
/// Mark shaders loaded this frame.
@ -110,6 +114,12 @@ public:
/// Return pixel shader defines.
const String& GetPixelShaderDefines() const { return pixelShaderDefines_; }
/// Return vertex shader define excludes.
const String& GetVertexShaderDefineExcludes() const { return vertexShaderDefineExcludes_; }
/// Return pixel shader define excludes.
const String& GetPixelShaderDefineExcludes() const { return pixelShaderDefineExcludes_; }
/// Return vertex shaders.
Vector<SharedPtr<ShaderVariation> >& GetVertexShaders() { return vertexShaders_; }
@ -117,6 +127,11 @@ public:
/// Return pixel shaders.
Vector<SharedPtr<ShaderVariation> >& GetPixelShaders() { return pixelShaders_; }
/// Return the effective vertex shader defines, accounting for excludes. Called internally by Renderer.
String GetEffectiveVertexShaderDefines() const;
/// Return the effective pixel shader defines, accounting for excludes. Called internally by Renderer.
String GetEffectivePixelShaderDefines() const;
private:
/// Pass index.
unsigned index_;
@ -142,6 +157,10 @@ private:
String vertexShaderDefines_;
/// Pixel shader defines.
String pixelShaderDefines_;
/// Vertex shader define excludes.
String vertexShaderDefineExcludes_;
/// Pixel shader define excludes.
String pixelShaderDefineExcludes_;
/// Vertex shaders.
Vector<SharedPtr<ShaderVariation> > vertexShaders_;
/// Pixel shaders.

View File

@ -19,6 +19,8 @@ class Pass : public RefCounted
void SetPixelShader(const String name);
void SetVertexShaderDefines(const String defines);
void SetPixelShaderDefines(const String defines);
void SetVertexShaderDefineExcludes(const String excludes);
void SetPixelShaderDefineExcludes(const String excludes);
void ReleaseShaders();
const String GetName() const;
@ -33,6 +35,8 @@ class Pass : public RefCounted
const String GetPixelShader() const;
const String GetVertexShaderDefines() const;
const String GetPixelShaderDefines() const;
const String GetVertexShaderDefineExcludes() const;
const String GetPixelShaderDefineExcludes() const;
tolua_readonly tolua_property__get_set String name;
tolua_readonly tolua_property__get_set unsigned index;
@ -46,6 +50,8 @@ class Pass : public RefCounted
tolua_property__get_set String pixelShader;
tolua_property__get_set String vertexShaderDefines;
tolua_property__get_set String pixelShaderDefines;
tolua_property__get_set String vertexShaderDefineExcludes;
tolua_property__get_set String pixelShaderDefineExcludes;
};
class Technique : public Resource

View File

@ -5,6 +5,6 @@
<pass name="prepass" vsdefines="NORMALMAP" psdefines="PREPASS NORMALMAP" />
<pass name="material" psdefines="MATERIAL" depthtest="equal" depthwrite="false" />
<pass name="deferred" vsdefines="NORMALMAP" psdefines="DEFERRED NORMALMAP" />
<pass name="depth" vs="Depth" ps="Depth" />
<pass name="shadow" vs="Shadow" ps="Shadow" />
<pass name="depth" vs="Depth" ps="Depth" psexcludes="PACKEDNORMAL" />
<pass name="shadow" vs="Shadow" ps="Shadow" psexcludes="PACKEDNORMAL" />
</technique>

View File

@ -4,6 +4,6 @@
<pass name="prepass" vsdefines="NORMALMAP" psdefines="PREPASS NORMALMAP" />
<pass name="material" vsdefines="AO" psdefines="MATERIAL AO" depthtest="equal" depthwrite="false" />
<pass name="deferred" vsdefines="NORMALMAP AO" psdefines="DEFERRED NORMALMAP AO" />
<pass name="depth" vs="Depth" ps="Depth" />
<pass name="shadow" vs="Shadow" ps="Shadow" />
<pass name="depth" vs="Depth" ps="Depth" psexcludes="PACKEDNORMAL" />
<pass name="shadow" vs="Shadow" ps="Shadow" psexcludes="PACKEDNORMAL" />
</technique>

View File

@ -1,5 +1,5 @@
<technique vs="LitSolid" ps="LitSolid" psdefines="DIFFMAP">
<pass name="alpha" vsdefines="AO" psdefines="AO" depthwrite="false" blend="alpha" />
<pass name="litalpha" vsdefines="NORMALMAP" psdefines="NORMALMAP" depthwrite="false" blend="addalpha" />
<pass name="shadow" vs="Shadow" ps="Shadow" />
<pass name="shadow" vs="Shadow" ps="Shadow" psexcludes="PACKEDNORMAL" />
</technique>

View File

@ -1,5 +1,5 @@
<technique vs="LitSolid" ps="LitSolid" psdefines="DIFFMAP">
<pass name="alpha" depthwrite="false" blend="alpha" />
<pass name="litalpha" vsdefines="NORMALMAP" psdefines="NORMALMAP" depthwrite="false" blend="addalpha" />
<pass name="shadow" vs="Shadow" ps="Shadow" />
<pass name="shadow" vs="Shadow" ps="Shadow" psexcludes="PACKEDNORMAL" />
</technique>

View File

@ -1,5 +1,5 @@
<technique vs="LitSolid" ps="LitSolid" vsdefines="TRANSLUCENT" psdefines="DIFFMAP TRANSLUCENT">
<pass name="alpha" depthwrite="false" blend="alpha" />
<pass name="litalpha" vsdefines="NORMALMAP" psdefines="NORMALMAP" depthwrite="false" blend="addalpha" />
<pass name="shadow" vs="Shadow" ps="Shadow" />
<pass name="shadow" vs="Shadow" ps="Shadow" psexcludes="PACKEDNORMAL" />
</technique>

View File

@ -4,6 +4,6 @@
<pass name="prepass" vsdefines="NORMALMAP" psdefines="PREPASS NORMALMAP" />
<pass name="material" psdefines="MATERIAL EMISSIVEMAP" depthtest="equal" depthwrite="false" />
<pass name="deferred" vsdefines="NORMALMAP" psdefines="DEFERRED NORMALMAP EMISSIVEMAP" />
<pass name="depth" vs="Depth" ps="Depth" />
<pass name="shadow" vs="Shadow" ps="Shadow" />
<pass name="depth" vs="Depth" ps="Depth" psexcludes="PACKEDNORMAL" />
<pass name="shadow" vs="Shadow" ps="Shadow" psexcludes="PACKEDNORMAL" />
</technique>

View File

@ -1,5 +1,5 @@
<technique vs="LitSolid" ps="LitSolid" psdefines="DIFFMAP">
<pass name="alpha" psdefines="EMISSIVEMAP" depthwrite="false" blend="alpha" />
<pass name="litalpha" vsdefines="NORMALMAP" psdefines="NORMALMAP" depthwrite="false" blend="addalpha" />
<pass name="shadow" vs="Shadow" ps="Shadow" />
<pass name="shadow" vs="Shadow" ps="Shadow" psexcludes="PACKEDNORMAL" />
</technique>

View File

@ -4,6 +4,6 @@
<pass name="prepass" vsdefines="NORMALMAP" psdefines="PREPASS NORMALMAP" />
<pass name="material" vsdefines="NORMALMAP ENVCUBEMAP" psdefines="MATERIAL NORMALMAP ENVCUBEMAP" depthtest="equal" depthwrite="false" />
<pass name="deferred" vsdefines="NORMALMAP ENVCUBEMAP" psdefines="DEFERRED NORMALMAP ENVCUBEMAP" />
<pass name="depth" vs="Depth" ps="Depth" />
<pass name="shadow" vs="Shadow" ps="Shadow" />
<pass name="depth" vs="Depth" ps="Depth" psexcludes="PACKEDNORMAL" />
<pass name="shadow" vs="Shadow" ps="Shadow" psexcludes="PACKEDNORMAL" />
</technique>

View File

@ -1,5 +1,5 @@
<technique vs="LitSolid" ps="LitSolid" psdefines="DIFFMAP">
<pass name="alpha" vsdefines="NORMALMAP ENVCUBEMAP" psdefines="NORMALMAP ENVCUBEMAP" depthwrite="false" blend="alpha" />
<pass name="litalpha" vsdefines="NORMALMAP" psdefines="NORMALMAP" depthwrite="false" blend="addalpha" />
<pass name="shadow" vs="Shadow" ps="Shadow" />
<pass name="shadow" vs="Shadow" ps="Shadow" psexcludes="PACKEDNORMAL" />
</technique>

View File

@ -5,6 +5,6 @@
<pass name="prepass" vsdefines="NORMALMAP" psdefines="PREPASS NORMALMAP SPECMAP" />
<pass name="material" psdefines="MATERIAL SPECMAP" depthtest="equal" depthwrite="false" />
<pass name="deferred" vsdefines="NORMALMAP" psdefines="DEFERRED NORMALMAP SPECMAP" />
<pass name="depth" vs="Depth" ps="Depth" />
<pass name="shadow" vs="Shadow" ps="Shadow" />
<pass name="depth" vs="Depth" ps="Depth" psexcludes="PACKEDNORMAL" />
<pass name="shadow" vs="Shadow" ps="Shadow" psexcludes="PACKEDNORMAL" />
</technique>

View File

@ -4,6 +4,6 @@
<pass name="prepass" vsdefines="NORMALMAP" psdefines="PREPASS NORMALMAP SPECMAP" />
<pass name="material" vsdefines="AO" psdefines="MATERIAL SPECMAP AO" depthtest="equal" depthwrite="false" />
<pass name="deferred" vsdefines="NORMALMAP AO" psdefines="DEFERRED NORMALMAP SPECMAP AO" />
<pass name="depth" vs="Depth" ps="Depth" />
<pass name="shadow" vs="Shadow" ps="Shadow" />
<pass name="depth" vs="Depth" ps="Depth" psexcludes="PACKEDNORMAL" />
<pass name="shadow" vs="Shadow" ps="Shadow" psexcludes="PACKEDNORMAL" />
</technique>

View File

@ -1,5 +1,5 @@
<technique vs="LitSolid" ps="LitSolid" psdefines="DIFFMAP">
<pass name="alpha" vsdefines="AO" psdefines="AO" depthwrite="false" blend="alpha" />
<pass name="litalpha" vsdefines="NORMALMAP" psdefines="NORMALMAP SPECMAP" depthwrite="false" blend="addalpha" />
<pass name="shadow" vs="Shadow" ps="Shadow" />
<pass name="shadow" vs="Shadow" ps="Shadow" psexcludes="PACKEDNORMAL" />
</technique>

View File

@ -1,5 +1,5 @@
<technique vs="LitSolid" ps="LitSolid" psdefines="DIFFMAP">
<pass name="alpha" depthwrite="false" blend="alpha" />
<pass name="litalpha" vsdefines="NORMALMAP" psdefines="NORMALMAP SPECMAP" depthwrite="false" blend="addalpha" />
<pass name="shadow" vs="Shadow" ps="Shadow" />
<pass name="shadow" vs="Shadow" ps="Shadow" psexcludes="PACKEDNORMAL" />
</technique>

View File

@ -4,6 +4,6 @@
<pass name="prepass" vsdefines="NORMALMAP" psdefines="PREPASS NORMALMAP SPECMAP" />
<pass name="material" psdefines="MATERIAL SPECMAP EMISSIVEMAP" depthtest="equal" depthwrite="false" />
<pass name="deferred" vsdefines="NORMALMAP" psdefines="DEFERRED NORMALMAP SPECMAP EMISSIVEMAP" />
<pass name="depth" vs="Depth" ps="Depth" />
<pass name="shadow" vs="Shadow" ps="Shadow" />
<pass name="depth" vs="Depth" ps="Depth" psexcludes="PACKEDNORMAL" />
<pass name="shadow" vs="Shadow" ps="Shadow" psexcludes="PACKEDNORMAL" />
</technique>

View File

@ -1,5 +1,5 @@
<technique vs="LitSolid" ps="LitSolid" psdefines="DIFFMAP">
<pass name="alpha" psdefines="EMISSIVEMAP" depthwrite="false" blend="alpha" />
<pass name="litalpha" vsdefines="NORMALMAP" psdefines="NORMALMAP SPECMAP" depthwrite="false" blend="addalpha" />
<pass name="shadow" vs="Shadow" ps="Shadow" />
<pass name="shadow" vs="Shadow" ps="Shadow" psexcludes="PACKEDNORMAL" />
</technique>

View File

@ -5,6 +5,6 @@
<pass name="prepass" vsdefines="NORMALMAP" psdefines="PREPASS NORMALMAP" />
<pass name="material" psdefines="MATERIAL" depthtest="equal" depthwrite="false" />
<pass name="deferred" vsdefines="NORMALMAP" psdefines="DEFERRED NORMALMAP" />
<pass name="depth" vs="Depth" ps="Depth" />
<pass name="shadow" vs="Shadow" ps="Shadow" />
<pass name="depth" vs="Depth" ps="Depth" psexcludes="PACKEDNORMAL" />
<pass name="shadow" vs="Shadow" ps="Shadow" psexcludes="PACKEDNORMAL" />
</technique>

View File

@ -1,5 +1,5 @@
<technique vs="LitSolid" ps="LitSolid">
<pass name="alpha" depthwrite="false" blend="alpha" />
<pass name="litalpha" vsdefines="NORMALMAP" psdefines="NORMALMAP" depthwrite="false" blend="addalpha" />
<pass name="shadow" vs="Shadow" ps="Shadow" />
<pass name="shadow" vs="Shadow" ps="Shadow" psexcludes="PACKEDNORMAL" />
</technique>

View File

@ -3,6 +3,6 @@
<pass name="light" depthtest="equal" depthwrite="false" blend="add" />>
<pass name="material" psdefines="MATERIAL" depthtest="equal" depthwrite="false" />
<pass name="deferred" psdefines="DEFERRED" />
<pass name="depth" vs="Depth" ps="Depth" />
<pass name="shadow" vs="Shadow" ps="Shadow" />
<pass name="depth" vs="Depth" ps="Depth" psexcludes="PACKEDNORMAL" />
<pass name="shadow" vs="Shadow" ps="Shadow" psexcludes="PACKEDNORMAL" />
</technique>

View File

@ -1,5 +1,5 @@
<technique vs="PBRLitSolid" ps="PBRLitSolid" psdefines="DIFFMAP SPECMAP EMISSIVEMAP NORMALMAP">
<pass name="alpha" depthwrite="false" blend="alpha" />
<pass name="litalpha" depthwrite="false" blend="addalpha" />
<pass name="shadow" vs="Shadow" ps="Shadow" />
<pass name="shadow" vs="Shadow" ps="Shadow" psexcludes="PACKEDNORMAL" />
</technique>

View File

@ -3,6 +3,6 @@
<pass name="light" depthtest="equal" depthwrite="false" blend="add" />
<pass name="material" psdefines="MATERIAL" depthtest="equal" depthwrite="false" />
<pass name="deferred" psdefines="DEFERRED" blend="add" />
<pass name="depth" vs="Depth" ps="Depth" />
<pass name="shadow" vs="Shadow" ps="Shadow" />
<pass name="depth" vs="Depth" ps="Depth" psexcludes="PACKEDNORMAL" />
<pass name="shadow" vs="Shadow" ps="Shadow" psexcludes="PACKEDNORMAL" />
</technique>

View File

@ -1,5 +1,5 @@
<technique vs="PBRLitSolid" ps="PBRLitSolid" vsdefines="IBL" psdefines="DIFFMAP NORMALMAP PBR IBL">
<pass name="alpha" depthwrite="false" blend="alpha" />
<pass name="litalpha" depthwrite="false" blend="addalpha" />
<pass name="shadow" vs="Shadow" ps="Shadow" />
<pass name="shadow" vs="Shadow" ps="Shadow" psexcludes="PACKEDNORMAL" />
</technique>

View File

@ -2,6 +2,6 @@
<pass name="light" depthtest="equal" depthwrite="false" blend="add" />
<pass name="material" psdefines="MATERIAL" depthtest="equal" depthwrite="false" />
<pass name="deferred" psdefines="DEFERRED" blend="add" />
<pass name="depth" vs="Depth" ps="Depth" />
<pass name="shadow" vs="Shadow" ps="Shadow" />
<pass name="depth" vs="Depth" ps="Depth" psexcludes="PACKEDNORMAL" />
<pass name="shadow" vs="Shadow" ps="Shadow" psexcludes="PACKEDNORMAL" />
</technique>

View File

@ -1,5 +1,5 @@
<technique vs="PBRLitSolid" ps="PBRLitSolid" vsdefines="IBL" psdefines="DIFFMAP NORMALMAP EMISSIVEMAP PBR IBL">
<pass name="alpha" depthwrite="false" blend="alpha" />
<pass name="litalpha" depthwrite="false" blend="addalpha" />
<pass name="shadow" vs="Shadow" ps="Shadow" />
<pass name="shadow" vs="Shadow" ps="Shadow" psexcludes="PACKEDNORMAL" />
</technique>

View File

@ -3,6 +3,6 @@
<pass name="light" depthtest="equal" depthwrite="false" blend="add" />
<pass name="material" psdefines="MATERIAL" depthtest="equal" depthwrite="false" />
<pass name="deferred" psdefines="DEFERRED" blend="add"/>
<pass name="depth" vs="Depth" ps="Depth" />
<pass name="shadow" vs="Shadow" ps="Shadow" />
<pass name="depth" vs="Depth" ps="Depth" psexcludes="PACKEDNORMAL" />
<pass name="shadow" vs="Shadow" ps="Shadow" psexcludes="PACKEDNORMAL" />
</technique>

View File

@ -3,6 +3,6 @@
<pass name="light" depthtest="equal" depthwrite="false" blend="add" />
<pass name="material" psdefines="MATERIAL" depthtest="equal" depthwrite="false" />
<pass name="deferred" psdefines="DEFERRED" blend="add"/>
<pass name="depth" vs="Depth" ps="Depth" />
<pass name="shadow" vs="Shadow" ps="Shadow" />
<pass name="depth" vs="Depth" ps="Depth" psexcludes="PACKEDNORMAL" />
<pass name="shadow" vs="Shadow" ps="Shadow" psexcludes="PACKEDNORMAL" />
</technique>

View File

@ -1,5 +1,5 @@
<technique vs="PBRLitSolid" ps="PBRLitSolid" vsdefines="IBL" psdefines="DIFFMAP NORMALMAP EMISSIVEMAP PBR IBL METALLIC ROUGHNESS">
<pass name="alpha" depthwrite="false" blend="alpha" />
<pass name="litalpha" depthwrite="false" blend="addalpha" />
<pass name="shadow" vs="Shadow" ps="Shadow" />
<pass name="shadow" vs="Shadow" ps="Shadow" psexcludes="PACKEDNORMAL" />
</technique>