Re: [osg-users] transfer data to shader with osg::texture

2016-10-05 Thread liu ming
hi Wojtek,Thank you very much,you perfect solved my problem.According to your code,Texture2D worked,maybe it is something wrong about Texture1D. Thank you. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=68887#68887

Re: [osg-users] transfer data to shader with osg::texture

2016-10-05 Thread liu ming
thank you for your reply ,I have tried your solution ,But it still is invaild,the Geometry shader can not get original input values.Are there other wrong in code?Thank you for your help. SMesserschmidt wrote: > Am 10/5/2016 um 3:37 AM schrieb liu ming: > > > Hi Wojtek ,Thank

Re: [osg-users] transfer data to shader with osg::texture

2016-10-05 Thread liu ming
yes,I am getting 0 and 1 in geometry shader,but my input values are : Code: *ptr1=osg::Vec3( 0.0,0.0,0.0); *ptr1++; *ptr1= osg::Vec3( 40.0,0.0,0.0); *ptr1++; *ptr1=osg::Vec3(

[osg-users] transfer data to shader with osg::texture

2016-10-04 Thread liu ming
Hi, I want to send a set of data to geometry shader with osg::texture,I've got a problem:in the geometry shader,I can use glsl function"texelFetch"to get the texel's values,and use the values to draw a triangle,But the values is not correct. the values always are "0" or "1",not the

Re: [osg-users] transfer data to shader with osg::texture

2016-10-04 Thread liu ming
Hi Wojtek ,Thank you for your reply,I have tried GL_RGBA16F_ARB instead like that "texture0->setInternalFormat(GL_RGBA16F_ARB);",but it seemed like not valid.The value still is 0..1 range.Are there other solutions? Thank you. -- Read this topic online here:

[osg-users] Save the image from computer shader

2016-10-15 Thread liu ming
Hi, I am learning the osg example "osgcomputeshaders",I have a problem that how can I save the image(the result of a computation) from shaders to my folder ? I use the code : Code: while(!viewer.done()) { viewer.frame();