Window Color Effect of Alpha

I noticed textures with Alpha will get outlined by the color of the window.

base.win.setClearColor(0, 0, 0, 1);

With that code, a texture with alpha will appear black around the edges.

Is there a way to set the window one color, and control how the edges of alpha textures appear (color wise)?

or should I set the window color to one color, create the level, and then set the window color to another color?

I disabled the DepthWrite and that got rid of the window color, however, the alpha texture kind of disappears with the ground surface behind it but not with other objects above ground.

It’s like the texture is being render against some objects behind it and not at all against other objects.

That is completely strange.

Ok, I came up with one of my little tricks again. The effect is exactly what I wanted, but it’ll work. :slight_smile:

You need to call set_transparency with the desired transparency mode to ensure that transparency works correctly.

True, but your alpha will still get outlined with or show a little of the window color in it. This is more evident when the camera is looking down at a ground surface, rather than a real world view (horizon level).

The outline isn’t too bad, since the black line is thin; kind of like the cartoon shader. The part I don’t like is, the window color slightly showing in parts of the texture that should be clear (from alpha).

I know alpha is blended against textures it overlap, but that’s just it… The window color should be ignored.

I don’t know what it is, so I’m not going to say it’s something that needs to be changed with the engine, but you Engine Developers might want to take a look into it.

You’ve read this, right?
panda3d.org/manual/index.ph … d_Blending

Any idea why textures with alpha will not blend against my world’s ground surface, but instead act like it’s not there and blend with the window color?

That’s has me confused. :confused:

The textures should be blending with the texture below it, which is the ground surface texture, but instead they are blending with the window color.

I wonder if using multiple textures (texture stages) on the ground surface is causing the issue?

It doesn’t matter what alpha mode is chosen, it’s the same issue for all.

P3D 1.7.0

Which transparency modes have you tried?

MDual and MMultisample (with samples enabled).

I did not experience this issue when I first started using P3D. Any textured object behind one with alpha blended into it. (but I never had alpha textures over another object that had multiple textures blended)

Now, every time I use a texture with alpha, the texture will have a black outline around it (window color is black), regardless of the object behind it.

I still believe having multiple textures (via texture stages) on the environment is some how effecting alpha textures above ground level.

The black outline isn’t too bad since it looks like a cartoon shader effect, but I would love to remove it if possible.

I discovered something new regarding the alpa issue.

It seems,

If I rotate my camera around to a certain angle (going 0 to 360 or 360 to 0) alpha will appear correctly!

So, certain world (over head angle) views will trigger the alpha in png and gif textures to appear correctly.

I’m hoping that can give rdb or Drwr something to go on. I really don’t know how P3D sorts its alpha; by bounding boxes, distance from camera…I haven’t a clue.

I just don’t understand why alpha is incorrect unless I rotate the camera to a certain degree. This problem is really hurting my game, since alpha within shadows are destroyed, making them hard instead of soft.

If alpha is sorted by bounding boxes, then how can I change the size of the bounding box around an object?

I’m completely puzzled by this one…

Thank GOD!!! :open_mouth:

I solved it!!

At least, part of it.

Even though I tried TransparencyAttrib.MMultisample, multiple times and it did not work, I got it to work this time because I set the priority (secound argument).

I did not test this with other settings like MDual or MAlpha.

This is not heart touching at all… :angry:

I never had to set the priority before with any alpha mode and now all of a sudden P3D demands me to do so… :unamused:

:cry:

Oh well, at least I have my clean alpha and that will alow me to move the graphics from “so so crummy” to “nice nice quality.” :smiley:

I can finally go back and do the night time lighting effect I wanted to do earlier.

You all should be in for a little treat when I post screenshots in showcase again. :slight_smile:

The visuals even stunned me a little, given the fact they are still so incomplete.

I’m only inserting some temp shadows right now. During the graphic stage, I wish to give them a more logical look according to structure rotation. It all depends on the amount of time I have before I reach my absolute deadline this year.

I tested setting priority with MDual and Malpha. The shadows vanished with MDual and had the previous alpha issue with MAlpha.

I was hoping MAlpha or MDual would have worked, since MMulisample is more expensive and really isn’t need for my game; but I guess I’m stuck with it. :frowning:

I will most likely use sprite based transparency for graphic cards that do not support multisamples. I will not test that until way later; not a priority at the moment.