public bool LoadShader()
        {
            prog = capi.Shader.NewShaderProgram();

            prog.VertexShader   = capi.Shader.NewShader(EnumShaderType.VertexShader);
            prog.FragmentShader = capi.Shader.NewShader(EnumShaderType.FragmentShader);

            capi.Shader.RegisterFileShaderProgram("mechpower", prog);

            prog.PrepareUniformLocations("rgbaFogIn", "rgbaAmbientIn", "fogMinIn", "fogDensityIn", "projectionMatrix", "modelViewMatrix", "tex");
            return(prog.Compile());
        }
Exemple #2
0
        public bool LoadShader()
        {
            prog = capi.Shader.NewShaderProgram();

            prog.VertexShader   = capi.Shader.NewShader(EnumShaderType.VertexShader);
            prog.FragmentShader = capi.Shader.NewShader(EnumShaderType.FragmentShader);

            capi.Shader.RegisterFileShaderProgram("clouds", prog);

            prog.PrepareUniformLocations("zNear", "zFar", "sunPosition", "sunColor", "dayLight", "windOffset", "playerPos", "globalCloudBrightness", "rgbaFogIn", "fogMinIn", "fogDensityIn", "flatFogDensity", "flatFogStart", "projectionMatrix", "modelViewMatrix", "shadowDistanceFar", "toShadowMapSpaceMatrixFar", "shadowDistanceNear", "toShadowMapSpaceMatrixNear", "pointLights", "pointLightColors", "pointLightQuantity", "cloudTileSize", "cloudsLength");

            return(prog.Compile());
        }
Exemple #3
0
        public void LoadShader()
        {
            overlayShaderProg = capi.Shader.NewShaderProgram();
            overlayShaderProg.VertexShader   = capi.Shader.NewShader(EnumShaderType.VertexShader);
            overlayShaderProg.FragmentShader = capi.Shader.NewShader(EnumShaderType.FragmentShader);

            overlayShaderProg.VertexShader.Code   = GetVertexShaderCode();
            overlayShaderProg.FragmentShader.Code = GetFragmentShaderCode();

            capi.Shader.RegisterMemoryShaderProgram("exampleoverlay", overlayShaderProg);
            overlayShaderProg.PrepareUniformLocations("time");
            overlayShaderProg.Compile();

            if (renderer != null)
            {
                renderer.overlayShaderProg = overlayShaderProg;
            }
        }
Exemple #4
0
        public bool LoadShader()
        {
            eyeShaderProg = capi.Shader.NewShaderProgram();

            eyeShaderProg.VertexShader   = capi.Shader.NewShader(EnumShaderType.VertexShader);
            eyeShaderProg.FragmentShader = capi.Shader.NewShader(EnumShaderType.FragmentShader);

            eyeShaderProg.VertexShader.Code   = VertexShaderCode;
            eyeShaderProg.FragmentShader.Code = FragmentShaderCode;

            capi.Shader.RegisterMemoryShaderProgram("sleepoverlay", eyeShaderProg);
            eyeShaderProg.PrepareUniformLocations("level");


            if (renderer != null)
            {
                renderer.eyeShaderProg = eyeShaderProg;
            }

            return(eyeShaderProg.Compile());
        }