Coppel.Damien Posted July 29, 2020 Share Posted July 29, 2020 (edited) Hello, I'm trying to set auxiliary_color from C++ API but only some colors seem available. For example: setting color like (255, 128, 185, 255) from c++ result in white color in my auxiliary texture instead of pink testMat->setState("auxiliary", 1); testMat->setParameterFloat4("auxiliary_color", vec4(255, 128, 185, 255)); // Result is white but a red color (255, 0, 0, 255) gives red result as expected testMat->setState("auxiliary", 1); testMat->setParameterFloat4("auxiliary_color", vec4(255, 0, 0, 255)); // Result is red as expected If I do it manually in the Editor I can set whatever color I want and it always work. I'm running 2.10.0.2 Unigine. Edited July 29, 2020 by Coppel.Damien Version precision Link to comment
rohit.gonsalves Posted July 29, 2020 Share Posted July 29, 2020 Dear @Coppel.Damien, Try the normalized color range. White. - vec4(1.0f, 1.0f, 1.0f, 1.0f); red. - vec4(1.0f, 0.0f, 0.0f, 1.0f); Your chosen color. - vec4(1.0f, 0.5f, 0.725f, 1.0f); Rohit Link to comment
Coppel.Damien Posted July 29, 2020 Author Share Posted July 29, 2020 Well I feel dumb for not trying that... Thanks a lot, it works now. Link to comment
Recommended Posts