|
I'm wondering if there is an solution for alpha blended particles flickering when I have 2 emitters overlapping. I require 2 emitters because I need 2 separate textures, and the additive particle materials make the particles wash out! Any thoughts? Thanks for your time!
(comments are locked)
|
|
You're describing Z-fighting. Add an Offset to the shader used for one of the particle emitters. Just copy the entire shader, and add the single line of code needed for offset. Offset -1, -1 will make the particles render in front, and Offset 1, 1 will make them render behind.
http://unity3d.com/support/documentation/Components/SL-CullAndDepth.html Hands down the best support I've had on a website! Thank you very much! I don't suppose you know where to find the built in shaders (for copying purposes)? I grabbed the built in shader pack from the Unity site, but that has a bunch of errors, possibly due to being an older version... In Unity I cant seem to locate: Particles/Alpha Blended" to duplicate it or grab the code. I looked through the project directories to no avail. Perhaps it's somewhere in the install dir. Thanks again!
Feb 18 '11 at 03:36 PM
Emericanized
I just tested this and had no problems. I grabbed the file at the link I provided above, added the appropriate shader to my project, and added the Offset line to it. What are you doing differently?
Feb 18 '11 at 04:22 PM
Jessy
Hey Jessy, Interesting! I downloaded the .zip package, and took the particle/Alpha Blended out and dropped it into my project. Unity then gave me 3 errors, as follows: ~Shader error in 'Particles/Alpha Blended': Program 'frag', undefined variable "UNITY_SAMPLE_DEPTH" at line 71 ~Shader error in 'Particles/Alpha Blended': Shader program had errors at line 25 ~Shader error in 'Particles/Alpha Blended': GLSL vertex shader: ERROR: 0:264: 'fixed4' : syntax error parse error at line 24 I should note that these errors happen before I make any alterations to the shader! -John
Feb 18 '11 at 05:31 PM
Emericanized
Are you using Unity 2.x? 3.2 yields no errors for me.
Feb 18 '11 at 05:54 PM
Jessy
3.1.0f3, pro trial at the moment!
Feb 18 '11 at 06:12 PM
Emericanized
(comments are locked)
|
