コード例 #1
0
 public JTerrainRenderer(JTerrainShader shader, Matrix4 projectionMatrix, JTerrainTexturePack texturePack)
 {
     TerrainShader = shader;
     shader.start();
     shader.LoadProjectionMatrix(projectionMatrix);
     shader.LoadTextures(texturePack.TerrainHeights, texturePack.Count);
     shader.stop();
 }
コード例 #2
0
        public JMasterRenderer(JTerrainTexturePack texturePack)
        {
            terrains = new List <JPerlinTerrain>();
            skyRed   = 0.5f;
            skyGreen = 0.5f;
            skyBlue  = 0.5f;

            GL.Enable(EnableCap.CullFace);
            GL.CullFace(CullFaceMode.Back);
            this.projectionMatrix = JMathUtils.createProjectionMatrix(JConfig.FOV, JConfig.NEAR_PLANE, JConfig.FAR_PLANE);
            this.Shader           = new JStaticShader();
            this.TerrainShader    = new JTerrainShader();
            this.Renderer         = new JEntityRenderer(Shader, projectionMatrix);
            this.TerrainRenderer  = new JTerrainRenderer(TerrainShader, projectionMatrix, texturePack);
            this.Entities         = new Dictionary <JTexturedModel, List <JEntity> >();
        }