public LCC3ShaderAttribute(LCC3ShaderProgram program, LCC3VertexAttrIndex attrIndex)
            : base(program, (int)attrIndex)
        {
            switch (attrIndex)
            {
                case LCC3VertexAttrIndex.VertexAttribPosition:
                    this.Semantic = LCC3Semantic.SemanticVertexLocation;
                    break;
                case LCC3VertexAttrIndex.VertexAttribNormal:
                    this.Semantic = LCC3Semantic.SemanticVertexNormal;
                    break;
                case LCC3VertexAttrIndex.VertexAttribColor:
                    this.Semantic = LCC3Semantic.SemanticColor;
                    break;
                case LCC3VertexAttrIndex.VertexAttribTexCoords:
                    this.Semantic = LCC3Semantic.SemanticVertexTexture;
                    break;
            }

            this.Location = attrIndex;
        }
Esempio n. 2
0
        public LCC3ShaderUniform UniformAtLocation(LCC3VertexAttrIndex uniformLocation)
        {
            foreach (LCC3ShaderUniform uniform in _uniformsSceneScope)
            {
                if (uniform.Location == uniformLocation)
                {
                    return uniform;
                }
            }

            foreach (LCC3ShaderUniform uniform in _uniformsNodeScope)
            {
                if (uniform.Location == uniformLocation)
                {
                    return uniform;
                }
            }

            foreach (LCC3ShaderUniform uniform in _uniformsDrawScope)
            {
                if (uniform.Location == uniformLocation)
                {
                    return uniform;
                }
            }

            return null;
        }
Esempio n. 3
0
        public LCC3ShaderAttribute AttributeAtLocation(LCC3VertexAttrIndex attributeLocation)
        {
            foreach (LCC3ShaderAttribute attribute in _attributes)
            {
                if (attribute.Location == attributeLocation)
                {
                    return attribute;
                }
            }

            return null;
        }
Esempio n. 4
0
 protected virtual void BindContentToAttributeAtIndexWithVisitor(object[] vertexData, LCC3VertexAttrIndex vaIdx, LCC3NodeDrawingVisitor visitor)
 {
     visitor.ProgramPipeline.BindVertexContentToAttributeAtIndex(vertexData, _elementType, _shouldNormalizeContent, vaIdx);
 }
Esempio n. 5
0
 public void BindContentToAttributeAtIndexWithVisitor(LCC3VertexAttrIndex vaIdx, LCC3NodeDrawingVisitor visitor)
 {
     if (_vertices != null && _vertexCount > 0)
     {
         this.BindContentToAttributeAtIndexWithVisitor(_vertices, vaIdx, visitor);
     }
 }
        public LCC3ShaderUniform UniformOverrideAtLocation(LCC3VertexAttrIndex location)
        {
            foreach (LCC3ShaderUniform uniform in _uniforms)
            {
                if (uniform.Location == location)
                {
                    return uniform;
                }
            }

            return this.AddUniformOverrideForUniform(_program.UniformAtLocation(location));
        }
 public static LCC3ShaderAttribute VariableInProgram(LCC3ShaderProgram program, LCC3VertexAttrIndex attrIndex)
 {
     return new LCC3ShaderAttribute(program, attrIndex);
 }