[osg-users] How to generate fixed alpha value?

Julien Valentin julienvalentin51 at gmail.com
Sun Nov 19 15:46:11 PST 2017


Hi Judy
there's no such thins as pseudo-random generator in glsl itself but you can code it for ex:Linear Congruent Generators : https://math.stackexchange.com/questions/337782/pseudo-random-number-generation-on-the-gpu
I haven't tested so give us experience feedbacks about this func

(Personnally I generally export random values collected in a image with CPU rand() func into a texture and sample it in the shader with gl_Instance_id )

Cheers


xdfanfan wrote:
> Hi all,
> Now,I have a flt. model with itself texture,but the internal format of the texture is RGB,not with ALPHA value,so the ALPHA TEST function is disabled.
> My question is how to generate some random fixed alpha value of the texture with the GLSL language,So that I can use the ALPHA TEST function to fufill the point cloud.
> 
> 
> Thanks very much!
> Judy
> 
>  ------------------
> Post generated by Mail2Forum


------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=72417#72417







More information about the osg-users mailing list