Exemplo n.º 1
0
        private static string CreateProtoPixelShader(ShaderEffectProps effectProps)
        {
            var protoPixelShader = new List <string>
            {
                HeaderShard.Version300Es,
                HeaderShard.EsPrecisionHighpFloat,

                FragPropertiesShard.InParams(effectProps),
                FragPropertiesShard.FuseeMatrixUniforms(),
                FragPropertiesShard.MaterialPropsUniforms(effectProps),
            };

            return(string.Join("\n", protoPixelShader));
        }
Exemplo n.º 2
0
        private static string CreatePixelShader(ShaderEffectProps effectProps)
        {
            var pixelShader = new List <string>
            {
                HeaderShard.Version300Es,
                HeaderShard.EsPrecisionHighpFloat,

                LightingShard.LightStructDeclaration,

                FragPropertiesShard.InParams(effectProps),
                FragPropertiesShard.FuseeMatrixUniforms(),
                FragPropertiesShard.MaterialPropsUniforms(effectProps),
                FragPropertiesShard.FixedNumberLightArray,
                FragPropertiesShard.ColorOut(),
                LightingShard.AssembleLightingMethods(effectProps)
            };

            //Calculates the lighting for all lights by using the above method
            pixelShader.Add(FragMainShard.ForwardLighting(effectProps));

            return(string.Join("\n", pixelShader));
        }