From 8f230211bb7be1c29fd8329e3727c8a22a2aefda Mon Sep 17 00:00:00 2001 From: Xavier Del Campo Romero Date: Thu, 2 Jan 2025 00:45:34 +0100 Subject: [PATCH] OsgCar.cpp: Do not create SDCarShader on "none" shaders Even if "none" shaders were selected, the game would still parse car.frag and execute the shaders, which is not the expected behaviour. --- src/modules/graphic/osggraph/Car/OsgCar.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/modules/graphic/osggraph/Car/OsgCar.cpp b/src/modules/graphic/osggraph/Car/OsgCar.cpp index 1717ddc14..38330605f 100644 --- a/src/modules/graphic/osggraph/Car/OsgCar.cpp +++ b/src/modules/graphic/osggraph/Car/OsgCar.cpp @@ -644,7 +644,8 @@ osg::ref_ptr SDCar::loadCar(tCarElt *Car, bool tracktype, bool subcat else this->reflectionMappingMethod = REFLECTIONMAPPING_OFF; - this->shader = new SDCarShader(car_shaded_body.get(), this); + if (_carShader > 0) + this->shader = new SDCarShader(car_shaded_body.get(), this); this->reflectionMapping = new SDReflectionMapping(this); this->setReflectionMap(this->reflectionMapping->getReflectionMap());