![Thumbnail](/uploads/content/previews/3dsphere.png)
Door: Thijs Zumbrink
08-12-2012 19:17
Are your LuxRender results washed-out and bland while using texturemaps? Did you try everything from tonemapping to adjusting lighting, without a good fix? Look no further, the solution is shamefully simple!
I just discovered that while using texture type: "imagemap", the default gamma should be 2.2, but this is not respected! So when you do not set the gamma, your results will be off. (At least via the LuxRender C++ interface.)
In code:
lux_paramset* texParams = CreateLuxParamSet();
texParams->AddString("filename", "mytexture.png");
texParams->AddString("wrap", "clamp");
texParams->AddString("mapping", "uv");
float gamma = 2.2f;
texParams->AddFloat("gamma", &gamma);
lux->texture("textureName", "color", "imagemap", texParams);
Add red part to make all your troubles go away.texParams->AddString("filename", "mytexture.png");
texParams->AddString("wrap", "clamp");
texParams->AddString("mapping", "uv");
float gamma = 2.2f;
texParams->AddFloat("gamma", &gamma);
lux->texture("textureName", "color", "imagemap", texParams);
The difference in terms of output:
![Geplaatste afbeelding](http://static.schalpoen.nl/content/img/cv5_groundtruth_s.png)
Ground truth
![Geplaatste afbeelding](http://static.schalpoen.nl/content/img/cv5_wrong_s.png)
Initial result
![Geplaatste afbeelding](http://static.schalpoen.nl/content/img/cv5_fixed_s.png)
After fix