Hi Enrico,

well I'm not a real expert but you can write a fragment program read the values from the cubemap and write them into the frame buffer and read the frame buffer via glReadPixels but that's not really fast.

Andreas

thanks andreas,
one more complicate question (and off topic too) :)
I stuff some pixels info inside a CubeTextureChunk, and so into an
OpenGL cube map. Once all the thing is inside the map, can i query it in
OpenSG to retrieve the value of the cell?
I mean, I have this cubemap, would it be possible to have something
like:

vec3f color = CubeTextureChunk->getTheStuff(TexCoord);

I dunno if this is even possible in OpenGL...
I hope so, cause it would help me a lot...
bye, Enrico

Il gio, 2004-07-15 alle 15:43, Andreas Zieringer ha scritto:

Hi Enrico,

yes this works, only user defined vertex attributes are not supported yet.

Andreas


Hi andreas,
sorry for my poor english!
making a little summary of this post i'd ask you:
if i assign vertices colors with ->setcolors, will i be able to retrieve
them in the shader using a command like:

outColor = gl_Color;

thx enrico

Il gio, 2004-07-15 alle 14:15, Andreas Zieringer ha scritto:


Hi Enrico,

to get the colors

GeometryPtr geo = ...

GeoColorsPtr colors = geo->getColors();

For the other poperties
GeoColorsPtr colors2 = geo->getSecondaryColors();
GeoTexCoordsPtr texcoord0 = geo->getTexCoords();
GeoTexCoordsPtr texcoord1 = geo->getTexCoords1();
....

To set them

if(colors == NullFC)
{
   // Geometry has no vertex colors so we create some.
   colors = GeoColors3f::create();
   beginEditCP(geo);
       geo->setColors(colors);
   endEditCP(geo);
   colors->resize(geo->getPositions()->getSize());
}

beginEditCP(colors);
for(UInt32 i=0;i<geo->getPositions()->getSize();++i)
{
   // set the color for each vertex.
   colors->setValue(Color3f(0.0, 0.0, 1.0), i);
}
endEditCP(colors);

if(geo->getIndexMapping().size() > 0)
{
   beginEditCP(geo);
   Int16 pi = geo->calcMappingIndex(Geometry::MapPosition);
   geo->getIndexMapping()[pi] |= Geometry::MapColor;
   endEditCP(geo);
}






hiya,
I am expanding my app, now after some playing with reflections and refractions, i'd like to add shades and colors, but for so doing, i need to get the color values of the vertices,
and the "illumination" level.
How do i pass the color to the shader? I think in the shader will be
something like

vec4 outColor = gl_Color;

but in OpenSG? A simple ->setColors(red) would do the trick?

Regarding the illumination level, it should be a simple float, ranging
[0,1], telling me how much light is hitting the point... where to store
that value per vertex? is there an unused slot that i can use to my
convenience? Something like a second texcoord set to use as a mere pipe
between OSG and the shader. So my shader should retrive the value like:

float lightlevel = gl_TexCoord[1].x;

hope someone can help,
enrico



-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users




-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users


--
Andreas Zieringer       [EMAIL PROTECTED]
Fraunhofer IGD - A4     phone +49 (0)6151 155 289
Fraunhoferstr. 5        fax   +49 (0)6151 155 196
D-64283 Darmstadt       www.igd.fhg.de/www/igd-a4


-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to