From d0e5790bdeac1a2ed6f77d480555469fee55bd56 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Tue, 10 Sep 2013 02:01:57 +0200 Subject: [PATCH] Set driver parameters --- .../driver/opengl/driver_opengl_uniform.cpp | 53 ++++++++++++++++++- 1 file changed, 52 insertions(+), 1 deletion(-) diff --git a/code/nel/src/3d/driver/opengl/driver_opengl_uniform.cpp b/code/nel/src/3d/driver/opengl/driver_opengl_uniform.cpp index 164a40558..382d2bd8a 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_uniform.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl_uniform.cpp @@ -309,7 +309,58 @@ bool CDriverGL::setUniformDriver(TProgram program) if (features.DriverFlags) { - // todo + if (features.DriverFlags & CGPUProgramFeatures::ModelView) + { + setUniformMatrix(program, prog->indices().ModelView, ModelView, Identity); + } + if (features.DriverFlags & CGPUProgramFeatures::ModelViewInverse) + { + setUniformMatrix(program, prog->indices().ModelViewInverse, ModelView, Inverse); + } + if (features.DriverFlags & CGPUProgramFeatures::ModelViewTranspose) + { + setUniformMatrix(program, prog->indices().ModelViewTranspose, ModelView, Transpose); + } + if (features.DriverFlags & CGPUProgramFeatures::ModelViewInverseTranspose) + { + setUniformMatrix(program, prog->indices().ModelViewInverseTranspose, ModelView, InverseTranspose); + } + if (features.DriverFlags & CGPUProgramFeatures::Projection) + { + setUniformMatrix(program, prog->indices().Projection, Projection, Identity); + } + if (features.DriverFlags & CGPUProgramFeatures::ProjectionInverse) + { + setUniformMatrix(program, prog->indices().ProjectionInverse, Projection, Inverse); + } + if (features.DriverFlags & CGPUProgramFeatures::ProjectionTranspose) + { + setUniformMatrix(program, prog->indices().ProjectionTranspose, Projection, Transpose); + } + if (features.DriverFlags & CGPUProgramFeatures::ProjectionInverseTranspose) + { + setUniformMatrix(program, prog->indices().ProjectionInverseTranspose, Projection, InverseTranspose); + } + if (features.DriverFlags & CGPUProgramFeatures::ModelViewProjection) + { + setUniformMatrix(program, prog->indices().ModelViewProjection, ModelViewProjection, Identity); + } + if (features.DriverFlags & CGPUProgramFeatures::ModelViewProjectionInverse) + { + setUniformMatrix(program, prog->indices().ModelViewProjectionInverse, ModelViewProjection, Inverse); + } + if (features.DriverFlags & CGPUProgramFeatures::ModelViewProjectionTranspose) + { + setUniformMatrix(program, prog->indices().ModelViewProjectionTranspose, ModelViewProjection, Transpose); + } + if (features.DriverFlags & CGPUProgramFeatures::ModelViewProjectionInverseTranspose) + { + setUniformMatrix(program, prog->indices().ModelViewProjectionInverseTranspose, ModelViewProjection, InverseTranspose); + } + if (features.DriverFlags & CGPUProgramFeatures::Fog) + { + setUniformFog(program, prog->indices().Fog); + } } return true;