Hi all! I was playing with different parameters for texturing my terrain over weekend, but with no satisfactory results. My idea is to have base layer (grass), and on top of it replace it with alpha blended different texture (snow, for example). In that way I will have a nice transition from grass to snow texture. Below are texture attribures for each TextureUnitState. No matter what parameters I tried, I can't isolate alpha texture to work only on one layer (snow). Is order of states important? What is best I can get are two textures combined (which is OK), but than alpha texture cuts off them both, not only snow (or grass). How could I achieve that?
//grass baseTextAtt = new TextureAttributes(); baseTextAtt.setTextureMode(TextureAttributes.REPLACE); //snow mainTextAtt = new TextureAttributes(); mainTextAtt.setTextureMode(TextureAttributes.COMBINE); mainTextAtt.setCombineRgbMode(TextureAttributes.COMBINE_REPLACE); mainTextAtt.setCombineRgbSource(0, TextureAttributes.COMBINE_TEXTURE_COLOR); mainTextAtt.setCombineRgbFunction(0, TextureAttributes.COMBINE_SRC_COLOR); mainTextAtt.setCombineAlphaMode(TextureAttributes.COMBINE_MODULATE); mainTextAtt.setCombineAlphaSource(0, TextureAttributes.COMBINE_PREVIOUS_TEXTURE_UNIT_STATE); mainTextAtt.setCombineAlphaFunction(0, TextureAttributes.COMBINE_SRC_ALPHA); //alpha mask for snow alphaTexAttr = new TextureAttributes(); alphaTexAttr.setTextureMode(TextureAttributes.COMBINE); alphaTexAttr.setCombineRgbMode(TextureAttributes.COMBINE_REPLACE); alphaTexAttr.setCombineRgbSource(0, TextureAttributes.COMBINE_PREVIOUS_TEXTURE_UNIT_STATE); alphaTexAttr.setCombineRgbFunction(0, TextureAttributes.COMBINE_SRC_COLOR); alphaTexAttr.setCombineAlphaMode(TextureAttributes.COMBINE_REPLACE); alphaTexAttr.setCombineAlphaSource(0, TextureAttributes.COMBINE_TEXTURE_COLOR); alphaTexAttr.setCombineAlphaFunction(0, TextureAttributes.COMBINE_SRC_ALPHA); =========================================================================== 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".