chris clepper a écrit :
You are most likely turning on software rendering by accessing the texture in the vertex shader.
Textures are uploaded as 8 bit per component which is the standard for images and video. Changing this to 32 bit floats is extremely inefficient. There might be a way to specify the GPU storage to be 32 bit float, but typically the driver would do the conversion slowly and not the GPU.
Render to texture using gemframebuffer with a 'format FLOAT' message will give a float texture to read from in the shaders. I see that you filed a bug that this object does not work on your machine though. Maybe you can try another?
all my computer are linux / nvidia, so i don't think changing computer will help. anyway, gemframebuffer crash, but i still can use it if i'm carfull.
so i tried. i did not succeed, but it's better. it did not work because mode 0 does ot work on gemframebuffer. if i use the exemple, toggeling mode 0 result in a uniform framebuffer (black or bleu if i press on "color 0 0 1") should i submit an other bug? (it look like diferent from the 1st one)
exept this problem, it's fast. so i think that if framfuffer could work on "mode 0", then this displacement mapping should work attachement is the patch i'm using, in case someone what to have a look
You could try changing the code in pix_texture and recompiling. Change the format from GL_UNSIGNED_BYTE to GL_FLOAT to see if that works and speeds it up. The uploaded texture will not contain the right values since the GPU expects a float and the image is still 8 bit.
ok, i have to find where this format is set, as there is no GL_UNSIGNED_BYTE in pix_texture code.
I probably won't have time to work on this for a few weeks, but I want to get the framebuffer working better.
ok.
On 9/9/07, cyrille henry cyrille.henry@la-kitchen.fr wrote:
hello,
i'm tring to do more physics on the GPU, and i'm facing some problems. simulation results can be compute on texture (just like the wave example i send month ago), so now i'd like to use this texture to move vertex.
if i acces to a texture with a vertex shader just like on a fragment shader, then it's very slow. (cpu is at 100%)
i found that : "vertex textures must be 32-bit-per-component textures, floating point, and they can't use any filtering mode except nearest filtering."
i tryed "quality 0" to pix_texture in order to have the nearest filtering mode, but i'm not sure about the 32 bit per component texture. is it the default on Gem? if no, is it possible to change it?
anyone already have an exemple how to use a texture to displace vertex?
thanks
cyrille
GEM-dev mailing list GEM-dev@iem.at http://lists.puredata.info/listinfo/gem-dev