multitexture

I have several decals layered on top of each other, and I would like to make any area that is not part of the decals transparent (not white-these are dynamically made) without losing parts of the decals? The decal’s transparency seems to be working, but there is a white background behind them. Is there a way to get rid of the white? I have tried making the bottom decal MAdd, but it seems to mess up the alpha of the other decals. These are declared using ts.setMode(TextureStage.MDecal) and some with the MBlend mode. I would greatly appreciate help of any kind :slight_smile:

Completely unrelated to the above, but how “safe” is manipulating a node after calling flattenStrong() on a parent? It seems to work for most things, but logic would dictate that it shouldn’t. Also, what commands are and aren’t safe after RigidBodyCombiner.collect()? Sometimes all I have used are nodepath.setPos() and nodepath.setScale() commands and the rigidbodycombiner resets everything inside of it to position (0,0,0). It feels almost as if I can do more to a flattenStrong()ed noded than a collect()ed one. :confused: Do texture commands work after collecting nodes? Is it “safe” to create intervals afterwards, to use collisions/set(get)PythonTag(self) to return a class from a node that has been collected?

you should just use shaders its not that complex. I have no clue how the old shader pipeline works while do some thing like this with shaders is dead easy!

treeform, I have never done shaders before, cI looked at some of the tutorials for them, but don’t quite understand them. What am I looking for?

The danger is that flattenStrong() might combine multiple nodes into one, so for instance if you are turning the front wheels on a car by lerping a particular node, after flattenStrong you might also be turning the back wheels with the same node. Or maybe the doors. Or maybe the whole car.

Not sure what you mean here. The RigidBodyCombiner should respect all transform changes, including setPos() and setScale(), and it shouldn’t arbitrarily reset things to position (0, 0, 0). If this is really happening, it may be a bug; or it may be that something has tricked you into thinking it is happening.

Collecting? You mean, with a RigidBodyCombiner, or with flatten? The RigidBodyCombiner cannot combine nodes with different textures, so if they have different textures to start with, there’s not much point to putting them together under a RigidBodyCombiner. Same problem with flatten. If they had the same texture to start with, then body the RigidBodyCombiner and flatten may be able to optimize it, but then you won’t be able to reliably change the texture later.

In general, a NodePath that referred to a node before a flatten operation will still refer to that node after the flatten operation, but now the node might include more geometry.

David

Calling rigidBodyCombiner.collect() (to clarify, when I say/said collect I meant this :wink: ) resets all of the nodes to 0,0,0. These nodes are dynamically created using geom’s, and all have the same texture, and the geoms themselves have the same vertice positions without any node transforms. They all appear as one object at Hpr 0,0,0 and pos 0,0,0 after collect. This does not happen with flattenStrong() or without collect at all, and is driving me slightly crazy…

I figured out the textures, and came up with this:

TextureStage.setCombineRgb(TextureStage.CMInterpolate, TextureStage.CSTexture, TextureStage.COSrcColor, TextureStage.CSPrevious, TextureStage.COSrcColor, TextureStage.CSTexture, TextureStage.COSrcAlpha)

TextureStage.setCombineAlpha(TextureStage.CMAdd, TextureStage.CSTexture, TextureStage.COSrcAlpha, TextureStage.CSPrevious, TextureStage.COSrcAlpha) 

Is this an acceptable way to do it without using shaders? (trying to allow non shader capable machines to be able to run it-they are fast, but have awful graphics cards)