public override void Init( FXEffect m_effect, FXConstantBuffer m_cb ) { // bind the local variables with the shader NumBoxX_Variable = m_cb.GetMemberByName<int>( VariableName + "_CheckerX" ); NumBoxY_Variable = m_cb.GetMemberByName<int>( VariableName + "_CheckerY" ); // set the default values NumBoxX_Variable.Set(_NumBoxX); NumBoxY_Variable.Set(_NumBoxY); }
public override void Init( FXEffect m_effect, FXConstantBuffer m_cb ) { // bind the local variables with the shader BrickWidth_Variable = m_cb.GetMemberByName<float>( VariableName + "_BrickWidth" ); BrickHeight_Variable = m_cb.GetMemberByName<float>( VariableName + "_BrickHeight" ); BrickShift_Variable = m_cb.GetMemberByName<float>( VariableName + "_BrickShift" ); MortarThickness_Variable = m_cb.GetMemberByName<float>( VariableName + "_MortarThickness" ); // set the default values BrickWidth_Variable.Set(_BrickWidth); BrickHeight_Variable.Set(_BrickHeight); BrickShift_Variable.Set(_BrickShift); MortarThickness_Variable.Set(_MortarThickness); }
public override void Init( FXEffect m_effect, FXConstantBuffer m_cb ) { // bind the local variables with the shader Color_Variable = m_cb.GetMemberByName<Vector3>( VariableName + "_Color" ); // set the default values Color_Variable.Set(_color); }
public override void Init( FXEffect m_effect , FXConstantBuffer m_cb ) { /// Bind the random Texture RandomTex_Variable = m_effect.GetResourceByName(VariableName + "_RandomTex"); /// Get the variables from Constant buffer MinValue_Variable = m_cb.GetMemberByName<float>( VariableName + "_MinValue" ); MaxValue_Variable = m_cb.GetMemberByName<float>( VariableName + "_MaxValue" ); Tile_X_Variable = m_cb.GetMemberByName<float>( VariableName + "_Tile_X" ); Tile_Y_Variable = m_cb.GetMemberByName<float>( VariableName + "_Tile_Y" ); Loops_Variable = m_cb.GetMemberByName<int>( VariableName + "_Loops" ); // create and set random texture SetRandomTex(_Seed); // set the values of the variables MinValue_Variable.Set(_MinValue); MaxValue_Variable.Set(_MaxValue); Loops_Variable.Set(_Loops); Tile_X_Variable.Set(_Tile_X); Tile_Y_Variable.Set(_Tile_Y); }
private void InitVariables() { m_ViewConstantBuffer = m_effect.GetConstantBufferByName( "cbViewMatrix" ); /// Obtain the variables from effect m_WorldInverseTranspose = m_ViewConstantBuffer.GetMemberByName<Matrix>( "g_mWorldInverseTrans" ); m_ViewInverse = m_ViewConstantBuffer.GetMemberByName<Matrix>( "g_mViewInverse" ); /// Matrix transformations m_WorldMatrixVariable = m_ViewConstantBuffer.GetMemberByName<Matrix>( "g_mWorld" ); m_ViewMatrixVariable = m_ViewConstantBuffer.GetMemberByName<Matrix>( "g_mView" ); m_WorldViewMatrixVariable = m_ViewConstantBuffer.GetMemberByName<Matrix>( "g_mWorldView" ); m_WorldViewProjectionMatrixVariable = m_ViewConstantBuffer.GetMemberByName<Matrix>("g_mWorldViewProjection"); m_ProjectionMatrixVariable = m_ViewConstantBuffer.GetMemberByName<Matrix>("g_mProjection"); m_ViewProjectionMatrixVariable = m_ViewConstantBuffer.GetMemberByName<Matrix>("g_mViewProjection"); /// Camera Position m_CameraPosition = m_ViewConstantBuffer.GetMemberByName<Vector3>("g_vCameraPosition"); /// Shader Variables m_MaterialBuffer = m_effect.GetConstantBufferByName( "cbMaterial" ); m_Diffuse = m_MaterialBuffer.GetMemberByName<Vector3>( "g_vMaterialDiffuse" ); m_Ambient = m_MaterialBuffer.GetMemberByName<Vector3>( "g_vMaterialAmbient" ); m_Opacity = m_MaterialBuffer.GetMemberByName<float>( "g_fMaterialAlpha" ); m_Specular = m_MaterialBuffer.GetMemberByName<Vector3>( "g_vMaterialSpecular" ); m_SpecularPower = m_MaterialBuffer.GetMemberByName<float>( "g_nMaterialShininess" ); }