Exemplo n.º 1
0
        protected override void InitShaderParameterTargets(Device device)
        {
            CShaderBufferDeclaration matrixBufferDeclaration = new CShaderBufferDeclaration();

            matrixBufferDeclaration.targetBuffer = m_matrixBuffer;
            matrixBufferDeclaration.targetSlot   = 0;
            matrixBufferDeclaration.targetStage  = EShaderTargetStage.Vertex;

            matrixBufferDeclaration.AddParameterTarget(SShaderParameterNames.WorldMatrixParameterName, EShaderParameterType.Matrix);
            matrixBufferDeclaration.AddParameterTarget(SShaderParameterNames.InvTransWorldMatrixParName, EShaderParameterType.Matrix);

            AddShaderBufferDeclaration(in matrixBufferDeclaration);

            CShaderBufferDeclaration matBufferDeclaration = new CShaderBufferDeclaration();

            matBufferDeclaration.targetBuffer = m_matDescBuffer;
            matBufferDeclaration.targetSlot   = 1;
            matBufferDeclaration.targetStage  = EShaderTargetStage.Pixel;
            matBufferDeclaration.AddParameterTarget(new SHashedName("tintColor"), EShaderParameterType.Color);
            matBufferDeclaration.AddParameterTarget(new SHashedName("specularColor"), EShaderParameterType.Color);
            matBufferDeclaration.AddParameterTarget(new SHashedName("specularPower"), EShaderParameterType.Scalar);

            AddShaderBufferDeclaration(matBufferDeclaration);

            SShaderTextureTarget diffuseTextureTarget;

            diffuseTextureTarget.parameterName = new SHashedName("diffuseTexture");
            diffuseTextureTarget.targetSlot    = 0;
            diffuseTextureTarget.targetStage   = EShaderTargetStage.Pixel;
            AddShaderTextureTarget(in diffuseTextureTarget);
        }
Exemplo n.º 2
0
        protected override void InitShaderParameterTargets(Device device)
        {
            CShaderBufferDeclaration matrixBufferDeclaration = new CShaderBufferDeclaration();

            matrixBufferDeclaration.targetBuffer = m_matrixBuffer;
            matrixBufferDeclaration.targetSlot   = 0;
            matrixBufferDeclaration.targetStage  = EShaderTargetStage.Vertex;

            matrixBufferDeclaration.AddParameterTarget(SShaderParameterNames.WorldMatrixParameterName, EShaderParameterType.Matrix);
            matrixBufferDeclaration.AddParameterTarget(SShaderParameterNames.InvTransWorldMatrixParName, EShaderParameterType.Matrix);

            AddShaderBufferDeclaration(in matrixBufferDeclaration);
        }
Exemplo n.º 3
0
        protected override void InitShaderParameterTargets(Device device)
        {
            CShaderBufferDeclaration matrixBufferDeclaration = new CShaderBufferDeclaration();

            matrixBufferDeclaration.targetBuffer = m_matrixBuffer;
            matrixBufferDeclaration.targetSlot   = 0;
            matrixBufferDeclaration.targetStage  = EShaderTargetStage.Vertex;

            matrixBufferDeclaration.AddParameterTarget(new SHashedName("mvpMatrix"), EShaderParameterType.Matrix);
            AddShaderBufferDeclaration(matrixBufferDeclaration);

            SShaderTextureTarget textureTarget;

            textureTarget.targetSlot    = 0;
            textureTarget.targetStage   = EShaderTargetStage.Pixel;
            textureTarget.parameterName = new SHashedName("texture");
            AddShaderTextureTarget(in textureTarget);
        }