mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-11 22:54:34 +00:00
Added support for uniforms, textures and samplers.
This commit is contained in:
parent
5019478aad
commit
74138342d1
7 changed files with 235 additions and 9 deletions
|
|
@ -50,19 +50,32 @@ singleton Material(cube_GridMaterial)
|
|||
mapTo = "GridMaterial";
|
||||
|
||||
CustomShaderFeature[0] = FlatColorFeature;
|
||||
CustomShaderFeatureUniforms[FlatColorFeature,0] = "TestFloat";
|
||||
};
|
||||
|
||||
//--- cube.dae MATERIALS END ---
|
||||
|
||||
//Voodoo!
|
||||
function FlatColorFeature::processVert(%this)
|
||||
function FlatColorFeature::processVertHLSL(%this)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
function FlatColorFeature::processPixelHLSL(%this)
|
||||
{
|
||||
%this.writeLine(" float bobsyeruncle = 15.915;");
|
||||
%this.addUniform("strudel", "float2");
|
||||
%this.addSampler("strudelMap");
|
||||
%this.addTexture("strudelTex", "Texture2D", "strudelMap");
|
||||
|
||||
%this.addVariable("bobsyeruncle", "float", 15.915);
|
||||
%this.addVariable("chimmychanga", "float");
|
||||
|
||||
%this.writeLine(" @ = @ * 2;", "chimmychanga", "bobsyeruncle");
|
||||
%this.writeLine(" @ *= @.x;", "bobsyeruncle", "strudel");
|
||||
%this.writeLine(" @ *= @.y;", "chimmychanga", "strudel");
|
||||
|
||||
%this.addVariable("sprangle", "float4");
|
||||
%this.writeLine(" @ = @.Sample(@,@);", "sprangle", "strudelTex", "strudelMap", "strudel");
|
||||
}
|
||||
|
||||
function FlatColorFeature::setTextureResources(%this)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue