1
Feature requests / The Ability to Pass Floats To/From Shaders
« on: October 23, 2015, 01:57:30 am »
Lol like... why is this not a feature? I can't even pass an array of floats to my fragment shader... What am I supposed to do? Convert each float to a 32-bit integer via static_cast, and pass 4 pieces of that integer to the shader via the r-g-b-a components of each pixel of a texture, then convert it back somehow in the shader via the sampler2D? Ridiculous.
And if I want to use a shader to output something to a render texture, the reverse problem applies because SFML doesn't use floats for components of sf::Color, which is insane. I mean, I know it's supposed to make it look cleaner or easier or whatever, but Uint8 components just don't make sense and form an unnecessary limitation on the developer. Why not just store color components as floats in sf::Color, and give the user a better class interface to use either Uint8/float depending on their code?
Or maybe there is just some secret way of doing this in the API that I just haven't found yet. Maybe someone can enlighten me?
And if I want to use a shader to output something to a render texture, the reverse problem applies because SFML doesn't use floats for components of sf::Color, which is insane. I mean, I know it's supposed to make it look cleaner or easier or whatever, but Uint8 components just don't make sense and form an unnecessary limitation on the developer. Why not just store color components as floats in sf::Color, and give the user a better class interface to use either Uint8/float depending on their code?
Or maybe there is just some secret way of doing this in the API that I just haven't found yet. Maybe someone can enlighten me?