UPBGE / upbge

UPBGE, the best integrated game engine in Blender
https://upbge.org
Other
1.39k stars 179 forks source link

object color supports HDR but vertex color does not #706

Open BluePrintRandom opened 6 years ago

BluePrintRandom commented 6 years ago

I don't know if this is possible, but can vertex color support HDR?

(so I can set the value greater than 1 etc?)

useful for bloom scripts I believe.

panzergame commented 6 years ago

It could be supported but this will slow down the update of vertex color as we need to identify what data type is used (float, char).

If some want to try it, RAS_DisplayArray use now SoA, so adding a new array for float colors is easier. VertexData should contains a std::vector m_floatColor and functions like GetColor and SetColor should check a mode enum stored in the display array to detect is we are using char or floats and do the conversion. From the VBO side no need is changed excepted that the memory format computed by the display array must be adapted, else the VAO request more modification to notice OpenGL to use unormalized float.

BluePrintRandom commented 6 years ago

what about having both behaviors [checkbox?]

On Jun 23, 2018 2:20 PM, "panzergame" notifications@github.com wrote:

It could be supported but this will slow down the update of vertex color as we need to identify what data type is used (float, char).

If some want to try it, RAS_DisplayArray use now SoA, so adding a new array for float colors is easier. VertexData should contains a std::vectormt::vec4_packed m_floatColor and functions like GetColor and SetColor should check a mode enum stored in the display array to detect is we are using char or floats and do the conversion. From the VBO side no need is changed excepted that the memory format computed by the display array must be adapted, else the VAO request more modification to notice OpenGL to use unormalized float.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/UPBGE/blender/issues/706#issuecomment-399711359, or mute the thread https://github.com/notifications/unsubscribe-auth/AG25WeeU5W9Y4J9ApgRs4lllg-6im5OPks5t_rEqgaJpZM4UXiQo .