Пример #1
0
        internal void AssignUniforms(Shader shader, ShaderUniformAssignmentHandler assignmentHandler)
        {
            this.textures.Clear();
            this.shader = shader;

            foreach (ShaderUniform uniform in this.shader.Uniforms)
            {
                this.currentlyToBeAssignedUniform = uniform;
                assignmentHandler(this, uniform);
            }

            this.currentlyToBeAssignedUniform = null;
            this.shader = null;
        }
Пример #2
0
        internal Renderable(ShaderVertexAttributeResolver attributeResolver, ShaderUniformAssignmentHandler shaderUniformAssignmentHandler, Shader shader, Mesh mesh)
        {
            if (attributeResolver == null)
            {
                Log.WriteLine($"Cannot create renderable, attributeResolver is null.");
                return;
            }

            if (shaderUniformAssignmentHandler == null)
            {
                Log.WriteLine($"Cannot create renderable, shaderUniformAssignmentHandler is null.");
                return;
            }

            this.resolvedMeshAttributes = new Dictionary <ShaderVertexAttribute, VertexAttribute>();

            this.uniformAssigner = new ShaderUniformAssigner();

            this.attributeResolver = attributeResolver;
            this.shaderUniformAssignmentHandler = shaderUniformAssignmentHandler;

            Shader = shader;
            Mesh   = mesh;
        }
Пример #3
0
 public static IRenderable CreateRenderable(ShaderVertexAttributeResolver attributeResolver, ShaderUniformAssignmentHandler shaderUniformAssignmentHandler, IShader shader, IMesh mesh)
 => ModBase.GraphicsHandler.CreateRenderable(attributeResolver, shaderUniformAssignmentHandler, shader, mesh);
Пример #4
0
 protected void CreateRenderable(ShaderVertexAttributeResolver attributeResolver, ShaderUniformAssignmentHandler shaderUniformAssignmentHandler, IShader shader, IMesh mesh)
 {
     Renderable = GraphicsHandler.CreateRenderable(attributeResolver, shaderUniformAssignmentHandler, shader, mesh);
 }