Encoding Vec4 into shader textures

Yo @Deltakosh (I always ping you)

Hey guys… Can anyone tell me the process of encoding uniforms into textures and then reading those values in the shader code.

Would i just encode the 4 values of my uniform (normalized 0 - 1) in the four channels of a color pixel ???

What size should i make the image ???

How do i read in shader ???

Is there a common practice for this sort of thing ???

Can anyone show me any examples of this type of thing… Please :slight_smile:

Here’s what I referenced. I generally use a resolution of 256.

http://aras-p.info/blog/2009/07/30/encoding-floats-to-rgba-the-final/

Galen