Game Development Community

Translucency.

by Chris Byars · in Torque Game Engine Advanced · 07/24/2006 (8:18 pm) · 29 replies

Figured I should make an actual thread for this rather than tacking onto others.

Translucency still does not render correctly if there's many translucent objects in a scene (like precipitation). If I rotate the view to view the player, the muzzle animation's full texture will render (including the black, which should be transparent), as seen in this age-old video that was posted on the TSE MS 3.5 release thread, and many other translucency threads I hijacked ;) . This problem appears on my translucent projectile, and translucent mesh explosion that appears where bullets strike, if precipitation or many translucent objects or particles exist in the scene.

Note that particles render perfectly fine; it's just meshes' translucency.

Also note, I have everything set up correctly [materials, meshes, code (stock) ].

This has been an issue ever since TSE began: translucent meshes don't stay translucent sometimes. It's not a serious bug, but it does make things look like crap. :)
Page «Previous 1 2
#1
07/24/2006 (8:41 pm)
Noticed it happening to explosions as well. I think they know about it though C2
#2
07/24/2006 (8:50 pm)
Likely, from my many posts, but I wanted to make sure they knew by posting here. :)

I just realized I didn't post in the bugs forum. -_-
#3
10/11/2006 (5:02 pm)
OK, I believe I may have found the problem. If you set the translucentBlendOp Material parameter to anything other than Add, Mul, or LerpAlpha, it could cause the alpha blend state to change randomly. I've fixed it in code and set up appropriate console errors so it's easy to find.

If those of you seeing translucency problems could check your Material settings and see if this fixes them, I'd appreciate it.
#4
10/11/2006 (5:31 pm)
I tried all of those Ops before to no avail. Maybe it's different now, so I'll check again.

Edit: Result - Failure

Place any type of precipitation into a mission. Proceed to fire weapon (which fires this projectile, a .dts translucent shape) or spawn .dts shape that has translucency. Observe nasty black background to apparent rectangular plane.

Place the "tracer" folder in "~/data/shapes/" and direct your projectile's .dts file to "~/data/shapes/tracer/tracer.dts".
#5
10/13/2006 (5:26 pm)
Yup, the sorting is still fuzzy when there are multiple transparent materials infront of eachother. Black instead of alpha.

On the randomly changing blend state thing, I noticed that before but will not be able to check before next week.
#6
10/17/2006 (3:52 pm)
The problem is that there is a nasty black background on the object? That's because you specified a "Mul" blend Op. You want the tracer to be additive, so you want the Add op. Try using these materials:

new Material(tracer1)
{
   baseTex[0] = "~/data/shapes/tracer/muzzle1";
   translucent[0] = true;
   translucentBlendOp = Add;
   emissive[0] = true;
};

new Material(tracer2)
{
   baseTex[0] = "~/data/shapes/tracer/side1";
   translucent[0] = true;
   translucentBlendOp = Add;
   emissive[0] = true;
};


That worked fine for me with the supplied projectile in precipitation.
#7
10/17/2006 (4:24 pm)
@Stefan - I think it's all the same problem, but I want to make sure. If anyone has any other test cases I could look at, let me know.
#8
10/17/2006 (7:08 pm)
Doesn't fix it. Shows up nicely about 40% of the time with precipitation, the rest its black background rather than alpha.
#9
10/18/2006 (12:13 pm)
@Chris - Can you reproduce this with one of the stock demos? I just went into the terrain_water_demo and placed a bunch of tracers down with precipitation and they look fine. There's either something else present that's messing them up in your mission, or some other changes I've made on this end fixed it.
#10
10/19/2006 (1:26 pm)
I really want to fix this one guys. If someone would be willing to send me a full example (preferably with source), it would be a big help.
#11
10/20/2006 (1:54 pm)
As soon as the precipitation is created, the tracer.dts static object I placed in my mission has a black background.

Without Precipitation

With Precipitation

Let me go check this on a stock build, though I doubt its anything I did to cause it.
#12
10/20/2006 (2:03 pm)
You are correct, it does not happen in the stock demo scripts (modified .exe, though). Leading back to my posts from a few months ago.



Using my modified TSE.exe in the stock demo scripts and my project's scripts reveals interesting issues.

1. Only in our project scripts, the server player is unable to go underwater. The camera cannot go under the surface of the water without crashing.

2. Only in our project scripts, the translucency problem as described above exists.


Slamming my head against the wall for nearly a year with these problems, now what the hell would cause those to happen? What script side could ever do something like that? What possibly could cause this? I've sifted through code hours upon hours over and over searching for the answer to these unbelieveablely weird two problems... to no solution.
#13
10/20/2006 (2:07 pm)
I'm going off to work soon and probably can't get to it til Monday but if C2 doesn't send you a full example , I could of the problem with explosions. Don't have any tracers though.
#14
10/20/2006 (2:10 pm)
Just saw C2's post. Does it still happen to you with explosions ie. create a dts shape explosion with animated textures with translucency?. I haven't tried explosions in probably atleast six months. I assumed that since it was still happening to you that it was still a problem.
#15
10/20/2006 (2:39 pm)
Mine's not animated, but basically any object set to have translucency on it, this problem occurs to.
#16
10/20/2006 (3:42 pm)
Quote:
1. Only in our project scripts, the server player is unable to go underwater. The camera cannot go under the surface of the water without crashing.

Are you sure you defined the materials it needs?
#17
10/20/2006 (4:01 pm)
Everything appears to be set correctly water-wise, unless it's a problem with some other script, what, I don't know. Client players are able to go underwater, though, and see everything as it should be, which baffles me.
#18
10/23/2006 (1:32 pm)
Well as far as ifl explosions in TSE or TAT with transparency, they are working for me even with the precipitation resource.
#19
10/23/2006 (3:37 pm)
I recently added support for mapping Materials to .ifl animations. So now you can have solid .ifls and shaderized .ifls. That will go out with next CVS push.
#20
10/23/2006 (6:01 pm)
@ Chris - just because it's not a problem with the stock demo scripts doesn't mean that it's not a problem in the code. Ie, it could be a C++ problem that just happens to be set of by something in your scripts. I suspect that the water problem is a missing shader file, Material, Cubemap, or some other texture.
Page «Previous 1 2