Esempio n. 1
0
 public Material CreateMaterial(
     RenderContext rc,
     string vertexShaderName,
     string fragmentShaderName,
     MaterialVertexInput vertexInputs,
     MaterialInputs <MaterialGlobalInputElement> globalInputs,
     MaterialInputs <MaterialPerObjectInputElement> perObjectInputs,
     MaterialTextureInputs textureInputs)
 {
     return(CreateMaterial(rc, vertexShaderName, fragmentShaderName, new[] { vertexInputs }, globalInputs, perObjectInputs, textureInputs));
 }
Esempio n. 2
0
        public Material CreateMaterial(
            RenderContext rc,
            string vertexShaderName,
            string fragmentShaderName,
            MaterialVertexInput[] vertexInputs,
            MaterialInputs <MaterialGlobalInputElement> globalInputs,
            MaterialInputs <MaterialPerObjectInputElement> perObjectInputs,
            MaterialTextureInputs textureInputs)
        {
            Shader                    vs               = CreateShader(ShaderType.Vertex, vertexShaderName);
            Shader                    fs               = CreateShader(ShaderType.Fragment, fragmentShaderName);
            VertexInputLayout         inputLayout      = CreateInputLayout(vs, vertexInputs);
            ShaderSet                 shaderSet        = CreateShaderSet(inputLayout, vs, fs);
            ShaderConstantBindings    constantBindings = CreateShaderConstantBindings(rc, shaderSet, globalInputs, perObjectInputs);
            ShaderTextureBindingSlots textureSlots     = CreateShaderTextureBindingSlots(shaderSet, textureInputs);

            DefaultTextureBindingInfo[] defaultTextureInfos = CreateDefaultTextureBindingInfos(rc, textureInputs);

            return(new Material(rc, shaderSet, constantBindings, textureSlots, defaultTextureInfos));
        }
Esempio n. 3
0
 public abstract ShaderConstantBindings CreateShaderConstantBindings(
     RenderContext rc,
     ShaderSet shaderSet,
     MaterialInputs <MaterialGlobalInputElement> globalInputs,
     MaterialInputs <MaterialPerObjectInputElement> perObjectInputs);