mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-16 00:54:54 +00:00
asdasd
This commit is contained in:
parent
86eb678f42
commit
524e5aad2d
13 changed files with 191 additions and 85 deletions
|
|
@ -49,6 +49,13 @@
|
||||||
#ifndef _MATSTATEHINT_H_
|
#ifndef _MATSTATEHINT_H_
|
||||||
#include "materials/matStateHint.h"
|
#include "materials/matStateHint.h"
|
||||||
#endif
|
#endif
|
||||||
|
#ifndef _GFXDEVICE_H_
|
||||||
|
#include "gfx/gfxDevice.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef CUSTOMSHADERBINDINGDATA_H
|
||||||
|
#include "materials/customShaderBindingData.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
struct RenderPassData;
|
struct RenderPassData;
|
||||||
class GFXVertexBufferHandleBase;
|
class GFXVertexBufferHandleBase;
|
||||||
|
|
@ -60,7 +67,6 @@ class GFXVertexFormat;
|
||||||
class MatrixSet;
|
class MatrixSet;
|
||||||
class ProcessedMaterial;
|
class ProcessedMaterial;
|
||||||
|
|
||||||
|
|
||||||
///
|
///
|
||||||
class BaseMatInstance
|
class BaseMatInstance
|
||||||
{
|
{
|
||||||
|
|
@ -155,6 +161,9 @@ public:
|
||||||
/// Sets node transforms for the current stage. Used for hardware skinning.
|
/// Sets node transforms for the current stage. Used for hardware skinning.
|
||||||
virtual void setNodeTransforms( const MatrixF *address, const U32 numTransforms ) = 0;
|
virtual void setNodeTransforms( const MatrixF *address, const U32 numTransforms ) = 0;
|
||||||
|
|
||||||
|
/// Sets custom shader data
|
||||||
|
virtual void setCustomShaderData(Vector<CustomShaderBindingData> &shaderData) = 0;
|
||||||
|
|
||||||
/// This initializes various material scene state settings and
|
/// This initializes various material scene state settings and
|
||||||
/// should be called after setupPass() within the pass loop.
|
/// should be called after setupPass() within the pass loop.
|
||||||
/// @see setupPass
|
/// @see setupPass
|
||||||
|
|
|
||||||
89
Engine/source/materials/customShaderBindingData.h
Normal file
89
Engine/source/materials/customShaderBindingData.h
Normal file
|
|
@ -0,0 +1,89 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#ifndef CUSTOMSHADERBINDINGDATA_H
|
||||||
|
#define CUSTOMSHADERBINDINGDATA_H
|
||||||
|
#ifndef _GFXDEVICE_H_
|
||||||
|
#include "gfx/gfxDevice.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
struct CustomShaderBindingData
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
enum UniformType
|
||||||
|
{
|
||||||
|
Float = 0,
|
||||||
|
Float2,
|
||||||
|
Float3,
|
||||||
|
Float4,
|
||||||
|
Texture2D,
|
||||||
|
Texture3D,
|
||||||
|
Cubemap,
|
||||||
|
Matrix2x2,
|
||||||
|
Matrix2x3,
|
||||||
|
Matrix2x4,
|
||||||
|
Matrix3x2,
|
||||||
|
Matrix3x3,
|
||||||
|
Matrix3x4,
|
||||||
|
Matrix4x2,
|
||||||
|
Matrix4x3,
|
||||||
|
Matrix4x4
|
||||||
|
};
|
||||||
|
private:
|
||||||
|
StringTableEntry targetedUniformName;
|
||||||
|
|
||||||
|
//ShaderConstHandles shaderConstHandle;
|
||||||
|
|
||||||
|
UniformType type;
|
||||||
|
|
||||||
|
F32 mFloat;
|
||||||
|
Point2F mFloat2;
|
||||||
|
Point3F mFloat3;
|
||||||
|
Point4F mFloat4;
|
||||||
|
|
||||||
|
//Image stuff
|
||||||
|
GFXTexHandle texture;
|
||||||
|
GFXSamplerStateDesc samplerState;
|
||||||
|
|
||||||
|
public:
|
||||||
|
void setFloat(StringTableEntry shaderConstName, F32 f)
|
||||||
|
{
|
||||||
|
targetedUniformName = shaderConstName;
|
||||||
|
mFloat = f;
|
||||||
|
type = Float;
|
||||||
|
}
|
||||||
|
F32 getFloat() { return mFloat; }
|
||||||
|
|
||||||
|
void setFloat2(StringTableEntry shaderConstName, Point2F f)
|
||||||
|
{
|
||||||
|
targetedUniformName = shaderConstName;
|
||||||
|
mFloat2 = f;
|
||||||
|
type = Float2;
|
||||||
|
}
|
||||||
|
Point2F getFloat2() { return mFloat2; }
|
||||||
|
|
||||||
|
void setFloat3(StringTableEntry shaderConstName, Point3F f)
|
||||||
|
{
|
||||||
|
targetedUniformName = shaderConstName;
|
||||||
|
mFloat3 = f;
|
||||||
|
type = Float3;
|
||||||
|
}
|
||||||
|
Point3F getFloat3() { return mFloat3; }
|
||||||
|
|
||||||
|
void setFloat4(StringTableEntry shaderConstName, Point4F f)
|
||||||
|
{
|
||||||
|
targetedUniformName = shaderConstName;
|
||||||
|
mFloat4 = f;
|
||||||
|
type = Float4;
|
||||||
|
}
|
||||||
|
Point4F getFloat4() { return mFloat4; }
|
||||||
|
|
||||||
|
StringTableEntry getHandleName() {
|
||||||
|
return targetedUniformName;
|
||||||
|
}
|
||||||
|
|
||||||
|
UniformType getType() {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
@ -472,6 +472,12 @@ void MatInstance::setNodeTransforms(const MatrixF *address, const U32 numTransfo
|
||||||
mProcessedMaterial->setNodeTransforms(address, numTransforms, getCurPass());
|
mProcessedMaterial->setNodeTransforms(address, numTransforms, getCurPass());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MatInstance::setCustomShaderData(Vector<CustomShaderBindingData> &shaderData)
|
||||||
|
{
|
||||||
|
PROFILE_SCOPE(MatInstance_setCustomShaderData);
|
||||||
|
mProcessedMaterial->setCustomShaderData(shaderData, getCurPass());
|
||||||
|
}
|
||||||
|
|
||||||
void MatInstance::setSceneInfo(SceneRenderState * state, const SceneData& sgData)
|
void MatInstance::setSceneInfo(SceneRenderState * state, const SceneData& sgData)
|
||||||
{
|
{
|
||||||
PROFILE_SCOPE(MatInstance_setSceneInfo);
|
PROFILE_SCOPE(MatInstance_setSceneInfo);
|
||||||
|
|
|
||||||
|
|
@ -66,6 +66,7 @@ public:
|
||||||
virtual bool setupPass(SceneRenderState *, const SceneData &sgData );
|
virtual bool setupPass(SceneRenderState *, const SceneData &sgData );
|
||||||
virtual void setTransforms(const MatrixSet &matrixSet, SceneRenderState *state);
|
virtual void setTransforms(const MatrixSet &matrixSet, SceneRenderState *state);
|
||||||
virtual void setNodeTransforms(const MatrixF *address, const U32 numTransforms);
|
virtual void setNodeTransforms(const MatrixF *address, const U32 numTransforms);
|
||||||
|
virtual void setCustomShaderData(Vector<CustomShaderBindingData> &shaderData);
|
||||||
virtual void setSceneInfo(SceneRenderState *, const SceneData& sgData);
|
virtual void setSceneInfo(SceneRenderState *, const SceneData& sgData);
|
||||||
virtual void setTextureStages(SceneRenderState * state, const SceneData &sgData );
|
virtual void setTextureStages(SceneRenderState * state, const SceneData &sgData );
|
||||||
virtual void setBuffers(GFXVertexBufferHandleBase* vertBuffer, GFXPrimitiveBufferHandle* primBuffer);
|
virtual void setBuffers(GFXVertexBufferHandleBase* vertBuffer, GFXPrimitiveBufferHandle* primBuffer);
|
||||||
|
|
|
||||||
|
|
@ -54,6 +54,7 @@ public:
|
||||||
|
|
||||||
virtual void setTransforms(const MatrixSet &matrixSet, SceneRenderState *state, const U32 pass);
|
virtual void setTransforms(const MatrixSet &matrixSet, SceneRenderState *state, const U32 pass);
|
||||||
virtual void setNodeTransforms(const MatrixF *address, const U32 numTransforms, const U32 pass) {;}
|
virtual void setNodeTransforms(const MatrixF *address, const U32 numTransforms, const U32 pass) {;}
|
||||||
|
virtual void setCustomShaderData(Vector<CustomShaderBindingData> &shaderData, const U32 pass) {;} //-JR
|
||||||
|
|
||||||
virtual void setSceneInfo(SceneRenderState *, const SceneData& sgData, U32 pass);
|
virtual void setSceneInfo(SceneRenderState *, const SceneData& sgData, U32 pass);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,10 @@
|
||||||
#include "materials/matStateHint.h"
|
#include "materials/matStateHint.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef CUSTOMSHADERBINDINGDATA_H
|
||||||
|
#include "materials/customShaderBindingData.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
class ShaderFeature;
|
class ShaderFeature;
|
||||||
class MaterialParameters;
|
class MaterialParameters;
|
||||||
class MaterialParameterHandle;
|
class MaterialParameterHandle;
|
||||||
|
|
@ -47,7 +51,6 @@ class GFXVertexBufferHandleBase;
|
||||||
class GFXPrimitiveBufferHandle;
|
class GFXPrimitiveBufferHandle;
|
||||||
class MatrixSet;
|
class MatrixSet;
|
||||||
|
|
||||||
|
|
||||||
/// This contains the common data needed to render a pass.
|
/// This contains the common data needed to render a pass.
|
||||||
struct RenderPassData
|
struct RenderPassData
|
||||||
{
|
{
|
||||||
|
|
@ -146,6 +149,9 @@ public:
|
||||||
|
|
||||||
/// Sets the node transforms for HW Skinning
|
/// Sets the node transforms for HW Skinning
|
||||||
virtual void setNodeTransforms(const MatrixF *address, const U32 numTransforms, const U32 pass) = 0;
|
virtual void setNodeTransforms(const MatrixF *address, const U32 numTransforms, const U32 pass) = 0;
|
||||||
|
|
||||||
|
/// Sets any custom shader data
|
||||||
|
virtual void setCustomShaderData(Vector<CustomShaderBindingData> &shaderData, const U32 pass) = 0;
|
||||||
|
|
||||||
/// Sets the scene info like lights for the given pass.
|
/// Sets the scene info like lights for the given pass.
|
||||||
virtual void setSceneInfo(SceneRenderState *, const SceneData& sgData, U32 pass) = 0;
|
virtual void setSceneInfo(SceneRenderState *, const SceneData& sgData, U32 pass) = 0;
|
||||||
|
|
|
||||||
|
|
@ -1300,6 +1300,46 @@ void ProcessedShaderMaterial::setNodeTransforms(const MatrixF *transforms, const
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ProcessedShaderMaterial::setCustomShaderData(Vector<CustomShaderBindingData> &shaderData, const U32 pass)
|
||||||
|
{
|
||||||
|
PROFILE_SCOPE(ProcessedShaderMaterial_setCustomShaderData);
|
||||||
|
|
||||||
|
GFXShaderConstBuffer* shaderConsts = _getShaderConstBuffer(pass);
|
||||||
|
ShaderConstHandles* handles = _getShaderConstHandles(pass);
|
||||||
|
|
||||||
|
for (U32 i = 0; i < shaderData.size(); i++)
|
||||||
|
{
|
||||||
|
for (U32 h = 0; h < handles->mCustomHandles.size(); ++h)
|
||||||
|
{
|
||||||
|
StringTableEntry handleName = shaderData[i].getHandleName();
|
||||||
|
bool tmp = true;
|
||||||
|
}
|
||||||
|
//roll through and try setting our data!
|
||||||
|
for (U32 h = 0; h < handles->mCustomHandles.size(); ++h)
|
||||||
|
{
|
||||||
|
StringTableEntry handleName = shaderData[i].getHandleName();
|
||||||
|
StringTableEntry rpdHandleName = handles->mCustomHandles[h].handleName;
|
||||||
|
if (handles->mCustomHandles[h].handleName == shaderData[i].getHandleName())
|
||||||
|
{
|
||||||
|
if (handles->mCustomHandles[h].handle->isValid())
|
||||||
|
{
|
||||||
|
CustomShaderBindingData::UniformType type = shaderData[i].getType();
|
||||||
|
|
||||||
|
if (type == CustomShaderBindingData::Float)
|
||||||
|
shaderConsts->setSafe(handles->mCustomHandles[h].handle, shaderData[i].getFloat());
|
||||||
|
else if (type == CustomShaderBindingData::Float2)
|
||||||
|
shaderConsts->setSafe(handles->mCustomHandles[h].handle, shaderData[i].getFloat2());
|
||||||
|
else if (type == CustomShaderBindingData::Float3)
|
||||||
|
shaderConsts->setSafe(handles->mCustomHandles[h].handle, shaderData[i].getFloat3());
|
||||||
|
else if (type == CustomShaderBindingData::Float4)
|
||||||
|
shaderConsts->setSafe(handles->mCustomHandles[h].handle, shaderData[i].getFloat4());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void ProcessedShaderMaterial::setSceneInfo(SceneRenderState * state, const SceneData& sgData, U32 pass)
|
void ProcessedShaderMaterial::setSceneInfo(SceneRenderState * state, const SceneData& sgData, U32 pass)
|
||||||
{
|
{
|
||||||
PROFILE_SCOPE( ProcessedShaderMaterial_setSceneInfo );
|
PROFILE_SCOPE( ProcessedShaderMaterial_setSceneInfo );
|
||||||
|
|
@ -1337,7 +1377,7 @@ void ProcessedShaderMaterial::setSceneInfo(SceneRenderState * state, const Scene
|
||||||
for ( U32 i=0; i < rpd->featureShaderHandles.size(); i++ )
|
for ( U32 i=0; i < rpd->featureShaderHandles.size(); i++ )
|
||||||
rpd->featureShaderHandles[i]->setConsts( state, sgData, shaderConsts );
|
rpd->featureShaderHandles[i]->setConsts( state, sgData, shaderConsts );
|
||||||
|
|
||||||
for (U32 i = 0; i < sgData.customShaderData.size(); i++)
|
/*for (U32 i = 0; i < sgData.customShaderData.size(); i++)
|
||||||
{
|
{
|
||||||
//roll through and try setting our data!
|
//roll through and try setting our data!
|
||||||
for (U32 h = 0; h < handles->mCustomHandles.size(); ++h)
|
for (U32 h = 0; h < handles->mCustomHandles.size(); ++h)
|
||||||
|
|
@ -1360,7 +1400,7 @@ void ProcessedShaderMaterial::setSceneInfo(SceneRenderState * state, const Scene
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
|
|
||||||
LIGHTMGR->setLightInfo( this, mMaterial, sgData, state, pass, shaderConsts );
|
LIGHTMGR->setLightInfo( this, mMaterial, sgData, state, pass, shaderConsts );
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,9 @@
|
||||||
#ifndef _GFXSHADER_H_
|
#ifndef _GFXSHADER_H_
|
||||||
#include "gfx/gfxShader.h"
|
#include "gfx/gfxShader.h"
|
||||||
#endif
|
#endif
|
||||||
|
#ifndef CUSTOMSHADERBINDINGDATA_H
|
||||||
|
#include "materials/customShaderBindingData.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
class GenericConstBufferLayout;
|
class GenericConstBufferLayout;
|
||||||
class ShaderData;
|
class ShaderData;
|
||||||
|
|
@ -140,6 +143,7 @@ public:
|
||||||
virtual void setTextureStages(SceneRenderState *, const SceneData &sgData, U32 pass );
|
virtual void setTextureStages(SceneRenderState *, const SceneData &sgData, U32 pass );
|
||||||
virtual void setTransforms(const MatrixSet &matrixSet, SceneRenderState *state, const U32 pass);
|
virtual void setTransforms(const MatrixSet &matrixSet, SceneRenderState *state, const U32 pass);
|
||||||
virtual void setNodeTransforms(const MatrixF *address, const U32 numTransforms, const U32 pass);
|
virtual void setNodeTransforms(const MatrixF *address, const U32 numTransforms, const U32 pass);
|
||||||
|
virtual void setCustomShaderData(Vector<CustomShaderBindingData> &shaderData, const U32 pass);
|
||||||
virtual void setSceneInfo(SceneRenderState *, const SceneData& sgData, U32 pass);
|
virtual void setSceneInfo(SceneRenderState *, const SceneData& sgData, U32 pass);
|
||||||
virtual void setBuffers(GFXVertexBufferHandleBase* vertBuffer, GFXPrimitiveBufferHandle* primBuffer);
|
virtual void setBuffers(GFXVertexBufferHandleBase* vertBuffer, GFXPrimitiveBufferHandle* primBuffer);
|
||||||
virtual bool stepInstance();
|
virtual bool stepInstance();
|
||||||
|
|
|
||||||
|
|
@ -51,6 +51,8 @@
|
||||||
#include "materials/shaderData.h"
|
#include "materials/shaderData.h"
|
||||||
#include "gfx/sim/cubemapData.h"
|
#include "gfx/sim/cubemapData.h"
|
||||||
|
|
||||||
|
#include "materials/customShaderBindingData.h"
|
||||||
|
|
||||||
const MatInstanceHookType DeferredMatInstanceHook::Type( "Deferred" );
|
const MatInstanceHookType DeferredMatInstanceHook::Type( "Deferred" );
|
||||||
const String RenderDeferredMgr::BufferName("deferred");
|
const String RenderDeferredMgr::BufferName("deferred");
|
||||||
const RenderInstType RenderDeferredMgr::RIT_Deferred("Deferred");
|
const RenderInstType RenderDeferredMgr::RIT_Deferred("Deferred");
|
||||||
|
|
@ -433,7 +435,10 @@ void RenderDeferredMgr::render( SceneRenderState *state )
|
||||||
|
|
||||||
//-JR
|
//-JR
|
||||||
//push along any overriden fields that are instance-specific as well
|
//push along any overriden fields that are instance-specific as well
|
||||||
//mat->setCustomShaderHandles()
|
if (passRI->mCustomShaderData.size() > 0)
|
||||||
|
{
|
||||||
|
mat->setCustomShaderData(passRI->mCustomShaderData);
|
||||||
|
}
|
||||||
|
|
||||||
// If we're instanced then don't render yet.
|
// If we're instanced then don't render yet.
|
||||||
if ( mat->isInstanced() )
|
if ( mat->isInstanced() )
|
||||||
|
|
|
||||||
|
|
@ -251,6 +251,13 @@ void RenderGlowMgr::render( SceneRenderState *state )
|
||||||
glowMat->setNodeTransforms(passRI->mNodeTransforms, passRI->mNodeTransformCount);
|
glowMat->setNodeTransforms(passRI->mNodeTransforms, passRI->mNodeTransformCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-JR
|
||||||
|
//push along any overriden fields that are instance-specific as well
|
||||||
|
if (passRI->mCustomShaderData.size() > 0)
|
||||||
|
{
|
||||||
|
mat->setCustomShaderData(passRI->mCustomShaderData);
|
||||||
|
}
|
||||||
|
|
||||||
glowMat->setSceneInfo(state, sgData);
|
glowMat->setSceneInfo(state, sgData);
|
||||||
glowMat->setBuffers(passRI->vertBuff, passRI->primBuff);
|
glowMat->setBuffers(passRI->vertBuff, passRI->primBuff);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -182,6 +182,13 @@ void RenderMeshMgr::render(SceneRenderState * state)
|
||||||
mat->setNodeTransforms(passRI->mNodeTransforms, passRI->mNodeTransformCount);
|
mat->setNodeTransforms(passRI->mNodeTransforms, passRI->mNodeTransformCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-JR
|
||||||
|
//push along any overriden fields that are instance-specific as well
|
||||||
|
if (passRI->mCustomShaderData.size() > 0)
|
||||||
|
{
|
||||||
|
mat->setCustomShaderData(passRI->mCustomShaderData);
|
||||||
|
}
|
||||||
|
|
||||||
setupSGData( passRI, sgData );
|
setupSGData( passRI, sgData );
|
||||||
mat->setSceneInfo( state, sgData );
|
mat->setSceneInfo( state, sgData );
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -249,6 +249,13 @@ void RenderTranslucentMgr::render( SceneRenderState *state )
|
||||||
mat->setNodeTransforms(passRI->mNodeTransforms, passRI->mNodeTransformCount);
|
mat->setNodeTransforms(passRI->mNodeTransforms, passRI->mNodeTransformCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-JR
|
||||||
|
//push along any overriden fields that are instance-specific as well
|
||||||
|
if (passRI->mCustomShaderData.size() > 0)
|
||||||
|
{
|
||||||
|
mat->setCustomShaderData(passRI->mCustomShaderData);
|
||||||
|
}
|
||||||
|
|
||||||
// If we're instanced then don't render yet.
|
// If we're instanced then don't render yet.
|
||||||
if ( mat->isInstanced() )
|
if ( mat->isInstanced() )
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -31,92 +31,16 @@
|
||||||
#include "gfx/gfxDevice.h"
|
#include "gfx/gfxDevice.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef _BASEMATINSTANCE_H_
|
||||||
|
#include "materials/baseMatInstance.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
class SceneRenderState;
|
class SceneRenderState;
|
||||||
class GFXCubemap;
|
class GFXCubemap;
|
||||||
class Frustum;
|
class Frustum;
|
||||||
class LightQuery;
|
class LightQuery;
|
||||||
class TSShape;
|
class TSShape;
|
||||||
|
|
||||||
struct CustomShaderBindingData
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
enum UniformType
|
|
||||||
{
|
|
||||||
Float = 0,
|
|
||||||
Float2,
|
|
||||||
Float3,
|
|
||||||
Float4,
|
|
||||||
Texture2D,
|
|
||||||
Texture3D,
|
|
||||||
Cubemap,
|
|
||||||
Matrix2x2,
|
|
||||||
Matrix2x3,
|
|
||||||
Matrix2x4,
|
|
||||||
Matrix3x2,
|
|
||||||
Matrix3x3,
|
|
||||||
Matrix3x4,
|
|
||||||
Matrix4x2,
|
|
||||||
Matrix4x3,
|
|
||||||
Matrix4x4
|
|
||||||
};
|
|
||||||
private:
|
|
||||||
StringTableEntry targetedUniformName;
|
|
||||||
|
|
||||||
//ShaderConstHandles shaderConstHandle;
|
|
||||||
|
|
||||||
UniformType type;
|
|
||||||
|
|
||||||
F32 mFloat;
|
|
||||||
Point2F mFloat2;
|
|
||||||
Point3F mFloat3;
|
|
||||||
Point4F mFloat4;
|
|
||||||
|
|
||||||
//Image stuff
|
|
||||||
GFXTexHandle texture;
|
|
||||||
GFXSamplerStateDesc samplerState;
|
|
||||||
|
|
||||||
public:
|
|
||||||
void setFloat(StringTableEntry shaderConstName, F32 f)
|
|
||||||
{
|
|
||||||
targetedUniformName = shaderConstName;
|
|
||||||
mFloat = f;
|
|
||||||
type = Float;
|
|
||||||
}
|
|
||||||
F32 getFloat() { return mFloat; }
|
|
||||||
|
|
||||||
void setFloat2(StringTableEntry shaderConstName, Point2F f)
|
|
||||||
{
|
|
||||||
targetedUniformName = shaderConstName;
|
|
||||||
mFloat2 = f;
|
|
||||||
type = Float2;
|
|
||||||
}
|
|
||||||
Point2F getFloat2() { return mFloat2; }
|
|
||||||
|
|
||||||
void setFloat3(StringTableEntry shaderConstName, Point3F f)
|
|
||||||
{
|
|
||||||
targetedUniformName = shaderConstName;
|
|
||||||
mFloat3 = f;
|
|
||||||
type = Float3;
|
|
||||||
}
|
|
||||||
Point3F getFloat3() { return mFloat3; }
|
|
||||||
|
|
||||||
void setFloat4(StringTableEntry shaderConstName, Point4F f)
|
|
||||||
{
|
|
||||||
targetedUniformName = shaderConstName;
|
|
||||||
mFloat4 = f;
|
|
||||||
type = Float4;
|
|
||||||
}
|
|
||||||
Point4F getFloat4() { return mFloat4; }
|
|
||||||
|
|
||||||
StringTableEntry getHandleName() {
|
|
||||||
return targetedUniformName;
|
|
||||||
}
|
|
||||||
|
|
||||||
UniformType getType() {
|
|
||||||
return type;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
/// A simple class for passing render state through the pre-render pipeline.
|
/// A simple class for passing render state through the pre-render pipeline.
|
||||||
///
|
///
|
||||||
/// @section TSRenderState_intro Introduction
|
/// @section TSRenderState_intro Introduction
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue