Hey, it has been some time, look, normally this is not a issue for me as it is only cosmetic and I have gotten used to it, however I recently joined a game jam and decided to rebuild my Vortex The Pretty Game for it as a Magical Girl Game.
Now, I just showed some of the progress that I was doing recently, and it seems people are not comfortable with the fact then when the character spins, her insides show up as her human character model disappears, if you played Whirligig Willies, you may have noticed this issue, and yes it does bother me, but I never found a really good reason to ask why that happens.
If you don’t know what I,am talking about here is a small picture of the issue in action.
it is obvious you can see her eyeballs, mouth, and petticoats, all show up out of her as she starts to disappear, and those objects all belong inside her, now is that time to ask, why? I read somewhere in the manual that using multisample or dual transparency fixes this, I,am using dual transparency, so I was wondering what I did wrong to get this sort of result.
Anyway Thank You to anyone with advice, or who can help me solve this issue, thanks.
Could you post the code that loads this character, please? (Including any settings that you apply to the NodePath(s) of the character, like setting “dual transparency”.)
Furthermore, what happens if you activate the “show-transparency” config-option? (By either including “show-transparency 1” in your “prc” file or running the following at the start of your program:
from panda3d.core import loadPrcFileData
loadPrcFileData("", "show-transparency 1")
If you do this, what elements of your model do you see flashing?
The “dual transparency” mode, if I’m not much mistaken, helps in certain specific circumstances, but isn’t a fix for all.
To quote the manual:
This only works well if the flats are typical cutouts, where there is a big solid part (alpha == 1.0) and a big transparent part (alpha == 0.0), and not a lot of semitransparent parts (0.0 < alpha < 1.0).
Is this in fact a transparency issue or is the model meant to be solid? If the models (or parts of it) are meant to be solid, then you should not enable transparency on those parts at all.
It’s hard to tell from the screenshot, but could it be that the model geometry is inside-out? Calling model.setTwoSided(True) is a quick way to check (but the right way to fix this is by flipping the faces in the modelling program).
give me a chance to test you loadprc trick and I will get back to you.
@panda3dmastercoder I will give it try and get back to you hold on.
Edit: it gives a error, “r” is not defined.
@rdb how would that be done? I just enable transparency on the actor, should I try a get get paren or child? but would that effect all the children too? model.setTwoSided is always set to true for each model loaded, but I also go out of my way to make sure each face is flipped in the right direction.
Okay, that indicates that all of those flashing elements are being treated as “transparent” (even if they’re not visibly so), which may be part of your problem.
(I’m not sure that it is the source of your problem, but it seems like it might be.)
You see, transparency generally calls for proper sorting. When the two transparent objects overlap significantly, then a shift in position can change which is calculated to be “nearer”, and thus the order in which they render.
In general, it’s wise, I think, to limit how many objects are treated as being transparent.
If you don’t intend for all of that to be transparent, then check your textures: it may be that some of them have alpha-channels, and are thus being considered to have transparency.
I wasn’t saying that it would become transparent–I was saying that it was being treated as though it were transparent: the elements are presumably being assigned to the “transparent” culling bin, and being sorted as transparent items are.
As to the flashing, if you mean the red, that’s the result of the “show-transparency” option, I believe: it’s using the red flashing to indicate which objects are considered to have transparency.
What I’d suggest, rather, is that you limit your glass feature to only those things that are glass. (And again, to check your textures for the presence of an alpha channel.) Let Panda sort things automatically.
As to doing it manually, “setBin” is exactly the thing to use, I believe.
well I have a cutscene feature that needs everything to be dynamic, I am looking at the issue more, and it seems the transparency is not sync which is causing the issue, like the outside model goes invisible before the insides, maybe if I do it by child to child basis, it might work?
Looks like you misunderstood. The setColor method takes for arguments, r, g, b and a. It sets the color with the rgba format, where r stands for red, g stands for green, b stands for blue and a stands for alpha. If you set the alpha to 1, it won’t be transparent at all. But as you keep on decreasing the number (0.9, 0.8, 0.7…), it becomes more transparent. 0 means that it is completely transparent and the color isn’t visible at all. So I gave r, g, b, 1 so that you could give your own rgb values but keep 1 for the alpha for no transparency. If you don’t know rgba color values, please read the following tutorial: Colors RGB.
Note: The tutorial is actually to apply RGB colors to a web page, but you can see how rgb gets rendered and use the same knowledge in Panda3D
EDIT: You can use the rgb calculator and find the colors. The calculator is in the same link. Only for alpha you have to do your own testing, seeing which alpha value works.
It won’t, I believe. Calling “setColor” and “setTransparency” won’t change which culling bin the object is sorted into. An object placed in the “transparent” bin will still be there, and so the object will be treated as though it were transparent–even if there are no pixels with an alpha-value below 1.
if you played whirligig willies, there is a scene where one of the amendments (a magic stamp) commands a solid wall of vines to disappear to let you through to the first level, I use transparency to achieve this. so that is way it is always on.