Hello *,
I want to create a Cubemap node, which makes the environment available for
all its children.
I'm shooting 6 pictures with a PerspectivCamera and use these as Cubemap.
Then I add the same CubeTextureChunk, TextureTransformChunk.... to all
children materials.
I would like to add my Cubemap to a textured material. The rendering should
filter the Cubemap-textures with the current SpecularColor (given by the
material). In other words: I want to filter ChunkMaterial(MaterialChunk,
TexturChunk, TexturTransformChunk, TexGenChunk,
CubetexturChunk,TexturTransformChunk, TexGenChunk) with further TexturChunks
(by setEnvMode(GL_COMBINE))).
The calculation should be done by multi-texture units.
I'd prefer the following calculation: m*t+s*c = f
m = MaterialColor for lighting
t = given TextureColor
s = SpecularColor of the material
C = CubemapColor (is constant)
f = result after texturing
My Problem: OpenSG would do the operation step by step ignoring the add and
mult order: so f would be (m * t + s) * c :(
So what can I do ?
I have the following idea:
f can be written as (m*t*1/s + c) * s but 1/s is greater than 1, so i have
to shift the value using the factor 1/16 !? At the end i could multiply my
result by 16 (4*4 using GL_RGB_SCALE).
So my step by step formula looks like that: (m*t*(1/16*1/s) + c*1/16) * 4 *
s * 4 = f
So c*1/16 can be pre-estimate.
Questions:
1. Is there a simple solution for my problem?
I don`t want to pre-estimate s*c because I need a different CubeMap-Texture
for each material with different SpecularColor.
2. In my solution I need the texture colors as float values. Is this
supported by the graphics card and how can I access this data format.
Whats the best way to multiply the factor 1/16 to my Cubemap-Texture?
Thanks in advance!
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
_______________________________________________
Opensg-users mailing list
Opensg-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensg-users