public override void Use(RenderState rstate, IVertexType vertextype, Lighting lights) { rstate.DepthEnabled = true; rstate.BlendMode = BlendMode.Opaque; ShaderVariables sh = GetShader(vertextype); sh.SetWorld(ref World); sh.SetViewProjection(Camera); sh.SetView(Camera); sh.SetAc(Ac); sh.SetDc(Dc); sh.SetTileRate(TileRate); sh.SetFlipU(FlipU); sh.SetFlipV(FlipV); sh.SetDtSampler(0); BindTexture(rstate, 0, DtSampler, 0, DtFlags); sh.SetDm1Sampler(1); BindTexture(rstate, 1, Dm1Sampler, 1, Dm1Flags); SetLights(sh, lights); var normalMatrix = World; normalMatrix.Invert(); normalMatrix.Transpose(); sh.SetNormalMatrix(ref normalMatrix); sh.UseProgram(); }
public override void Use(RenderState rstate, IVertexType vertextype, ref Lighting lights) { rstate.DepthEnabled = true; rstate.BlendMode = BlendMode.Opaque; ShaderVariables sh = GetShader(vertextype); sh.SetWorld(World); sh.SetViewProjection(Camera); sh.SetView(Camera); sh.SetAc(Ac); sh.SetDc(Dc); sh.SetTileRate(TileRate); sh.SetFlipU(FlipU); sh.SetFlipV(FlipV); sh.SetDtSampler(0); BindTexture(rstate, 0, DtSampler, 0, DtFlags); sh.SetDm1Sampler(1); BindTexture(rstate, 1, Dm1Sampler, 1, Dm1Flags, ResourceManager.GreyTextureName); SetLights(sh, ref lights); sh.UseProgram(); }