Sign in to follow this  
photo

Setting auxiliary_color from C++ API - Color error

Recommended Posts

Posted (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 by Coppel.Damien
Version precision

Share this post


Link to post

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

Share this post


Link to post

Well I feel dumb for not trying that... Thanks a lot, it works now.

Share this post


Link to post
Sign in to follow this