Jump to content

Transparency Nightmares


Rekindled Phoenix
 Share

Recommended Posts

I have had the most difficulty creating transparency that doesn't cause a graphical glitch like the image below. Browsing through the tutorials, it seems that none of them reference using the FramewOrk methods. Do they automatically set the clearmode appropriately?

 

Neither smoke (alpha) or fire (light) MAT settings work to fix this issue. I've also tried creating my own textures to replace the defaults, and have had no luck.

 

Either way, this is my basic emitter setup in C#.

 

//transparency refers to foreground
World.Current = Framework.Layers.Transparency.World;
Framework.Layers.Transparency.Camera.ClearMode = CameraClearMode.None;
Emitter flames = new Emitter(new Vector3(-.5F, -.5F, 0),200);
flames.Material = Material.Load("abstract::fire.mat");
flames.Area = new Vector3(.2F, 1, .2F);
flames.Radii = new Radii(.5F, 0);
flames.Waver = 1;
World.Current = Framework.Layers.Main.World;

 

 

In case you're wondering about the enum values

 

public enum CameraClearMode : int //byte
{
Unique = -1, // suggested by Canardian, only godrays visible
None = 0,
Depth = 1,
Color = 2,
}

 

I'm so frustrated, if this doesn't get fixed it's possible I may have to use another engine at this point.

 

Please help, oh wise and knowledgeable forum users. So you have a secret transparency recipe?

 

post-214-0-14215300-1359323475.png

post-214-0-66802300-1359324260.png

 

EDIT: Secondly, why does the vertical camera angle effect particle intensity?

Link to comment
Share on other sites

Yeah, tried different methods (as mentioned above) for both types. Here's an custom mat that's similar to the smoke.mat

 

texture0="abstract::flame-blur2.dds"
depthmask=0
blend=alpha
zsort=1
shader="abstract::particles.vert","abstract::particles.frag"

 

It's using blend=alpha. I assume that's the same as a 'transparency' setting.

Link to comment
Share on other sites

Try this, instead of

 

shader="abstract::particles.vert","abstract::particles.frag"

 

 

this,

shader="abstract::particles.vert","abstract::particles_alpha.frag"

Win7 64bit, Leadwerks SDK 2.5, Visual Studio 2012, 3DWS, 3ds Max, Photoshop CS5.

 

 

 

Life is too short to remove USB safely.

Link to comment
Share on other sites

As DigitalHax has alluded to, the key thing here is the shader usage and definition. As a general rule:

 

Use _alphatest versions of the frag shaders for full transparency (is either fully transparent or not) which can be used in the main world. So great for things like vegetation etc. This treats all transparency values above a threshold value as fully transparent and is more efficient to render.

 

Use _alpha versions for all graduated transparency which needs to be in the transparency world.

Intel Core i5 2.66 GHz, Asus P7P55D, 8Gb DDR3 RAM, GTX460 1Gb DDR5, Windows 7 (x64), LE Editor, GMax, 3DWS, UU3D Pro, Texture Maker Pro, Shader Map Pro. Development language: C/C++

Link to comment
Share on other sites

Also to your other problem, it might be that the particles can appear blurry, as usually the particles are rendered in the foreground world, and so if it is being viewed over the skybox, and with DOF activated it will treat the particles as being far away. Just disable DOF if possible.

  • Upvote 1

Win7 64bit, Leadwerks SDK 2.5, Visual Studio 2012, 3DWS, 3ds Max, Photoshop CS5.

 

 

 

Life is too short to remove USB safely.

Link to comment
Share on other sites

  • 2 weeks later...

Thanks guys for all of your answers

 

Still stuggling, since the .frag file you mentioned is missing...

 

Try this

shader="abstract::particles.vert","abstract::particles_alpha.frag"

 

I looked throughout the shaders.pak (version 2.5) and I didn't see anything labeled with particles and an alpha frag shader. When I try to use them anyway, since I assumed they were special labels at first, my application freezes.

 

post-214-0-26696400-1360535724.png

 

Does the example in the underground scene work?

 

Yes, though nothing in that scene exposes particles to the skybox. I'm running a scene within a large open outdoors area, so the chances of particles overlapping the background are high.

 

Could you please attach the appropriate frag shaders to this post?

Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...