Hi Jonathan,
On Tue, 2005-03-15 at 10:26 -0500, Jonathan Bard wrote:
> Hi,
>
> Sorry, it wasn't a bug in OpenSG. I tried so many things that I didn't
> realize I
> was using a sampler2D in my glsl shader instead of a sampler3D... And so
> OpenSG
> was forced to use the last 2D texture, I presume, which led to this behaviour
> (the one I described 2 mails ago).
Yeah, I suspect that, but it seemed to simple to be the problem, so I
didn't mention it. Doh! ;)
> Now, the problem is that my shader produces a black texture, whereas I filled
> my
> 3D texture with random colors. I know my texture coordinates are alright,
> because when I use the fragment shader instruction : gl_FragColor =
> vec4(texCoord.xyz,1.0); I can see the colors of the pixels changing from green
> to red.
> I use the fragment shader instruction :
> gl_FragColor = vec4(texture3D(TextureEssai,texCoord.xyz).rgb,1.0);
> in order to present the color of my 3D texture on the screen. And that leads
> to
> pure black.
> I've already talked about what I'm doing to create all the chunks, etc. And
> neither OpenGL nor OpenSG produces an error when my application compiles and
> links the SHLChunk, which means that the constant parameters are OK, I think.
> When I generate the texture, I use the code :
> beginEditCP(img, Image::PixelFieldMask);
> {
> UInt8 *data = img->getData();
> UIntRGB valeurPixel;
> // ... valeurPixel calculations ...
> memcpy( &(data[ic*3]), &valeurPixel, 3*sizeof(UInt8) );
> }
> endEditCP(img, Image::PixelFieldMask);
> where UIntRGB is a small struct to stock the UInt8 of the 3 colors. I also
> printed the values data[ic*3], data[ic*3+1] and data[ic*3+2] after the memcpy
> and they are alright. Then I call imageContentChanged() on the texture chunks
> which use this image.
> So what's wrong in my application ? Any idea ?
Not really. Although the green to red means you're only going to see one
slice of your 3D texture. Have you tried using an additive blend
function, to see if you're really getting anything anywhere?
> And that would be really cool if someone answered the questions I asked in my
> last mail, about the TextureChunk stuff, because it is not quite clear to me.
I hope I just did that, if not please repost.
Dirk
--
-- Dirk Reiners OpenSG Forum [EMAIL PROTECTED]
-- The OpenSG Open Source Scenegraph: http://www.opensg.org
-- Announcements: http://lists.sf.net/lists/listinfo/opensg-announce
-------------------------------------------------------
This SF.net email is sponsored by Microsoft Mobile & Embedded DevCon 2005
Attend MEDC 2005 May 9-12 in Vegas. Learn more about the latest Windows
Embedded(r) & Windows Mobile(tm) platforms, applications & content. Register
by 3/29 & save $300 http://ads.osdn.com/?ad_id=6883&alloc_id=15149&op=click
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users