Hi, I have a question about achieving desired lighting/shading effects while using multitextures in a science visualization.
My scene's sole Shape3D is a surface based on elevation data for California, and has an Appearance with Material mat = new Material( new Color3f(0.0f,0.0f,0.0f), new Color3f(0.0f,0.0f,0.0f), new Color3f(1.0f,1.0f,1.0f), new Color3f(0.0f,0.0f,0.0f), 10.0f) and 2 TextureUnitStates as follows: The first TextureUnitState has a satellite image to make the terrain appear realistic. It is applied in MODULATE TextureMode, so that it will shade appropriately as the Shape3D is moved around. The second TextureUnitState has a software-generated ImageComponent2D which represents snow cover (eg, white where there is snow, transparent where there is none). This is generated using output from a snowpack model, and the idea is to generate animations illustrating the response of California's snowpack to global warming scenarios. I can apply this second (snow) Texture in DECAL mode and it is appropriately draped over the previous TextureUnitState representing the landscape. However, there is of course no shading of the resulting snowpack, and much of the sense of the terrain's detail is lost wherever there is snow. I need to have the snow TextureUnitState be shaded as well, if the final product is to appear realistic. If I try TexAttSnow.setTextureMode(TextureAttributes.COMBINE); TexAttSnow.setCombineRgbMode(TextureAttributes.COMBINE_MODULATE); TexAttSnow.setCombineRgbSource(0,TextureAttributes.COMBINE_OBJECT_COLOR); then the snow is appropriately shaded, but the first TextureUnitState with the satellite image is no longer visible. But I'm not sure I understand all the possibilities of COMBINE mode, and I can't seem to find a good explanation...is there any way to make both Textures appear and shade? The problem seems to be that there are 3 color sources involved in generating the final image-- the object color needs to be used to modulate both textures so they are properly shaded, the resulting satellite image needs to be visible wherever the snow image is transparent, and finally the snow image (modulated with the object color) needs to be draped over the landscape. One solution which won't work well in my case is to copy the satellite image, then draw the snow directly onto it and use that as the only texture-- that would increase memory requirements too much (the satellite Texture is 4096x4096, while the snow Texture is only 256x256). Thanks for any suggestions. Noah =========================================================================== To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JAVA3D-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".
