Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  How to disable shadows of particles?
#1
Hey there! Hope you are doing great!

I've checked fluid rendering FAQ, but I haven't seen how to disable shadows of particles. I've tried both forward and deffered Rendering Paths with no luck.
I am using built-in renderer.

Could you please tell me is there any chance to disable shadows of particles?

Thanks in advance!
Reply
#2
(14-02-2023, 01:19 AM)Rearden Wrote: Hey there! Hope you are doing great!

I've checked fluid rendering FAQ, but I haven't seen how to disable shadows of particles. I've tried both forward and deffered Rendering Paths with no luck.
I am using built-in renderer.

Could you please tell me is there any chance to disable shadows of particles?

Thanks in advance!

Hi there!

There's no exposed option to disable particle shadows (taking note to add this in the next version). You can however slightly modify ObiParticleRender.cs, look for the DrawParticlesMethod at the end of the file, and change this line:


Code:
Graphics.DrawMesh(mesh, Matrix4x4.identity, ParticleMaterial, gameObject.layer);

To this:

Code:
Graphics.DrawMesh(mesh, Matrix4x4.identity, ParticleMaterial, gameObject.layer,null,0,null,false);

That last "false" boolean parameter determines whether particles cast shadows or not.

The entire method should end up looking like this:

Code:
private void DrawParticles()
        {
            if (ParticleMaterial != null)
            {

                ParticleMaterial.SetFloat("_RadiusScale", radiusScale);
                ParticleMaterial.SetColor("_Color", particleColor);

                // Send the meshes to be drawn:
                if (render)
                {
                    var meshes = ParticleMeshes;
                    foreach (Mesh mesh in meshes)
                        Graphics.DrawMesh(mesh, Matrix4x4.identity, ParticleMaterial, gameObject.layer,null,0,null,false);
                }
            }

        }

let me know if I can be of further help,

kind regards,
Reply
#3
Thank you for the quick answer! Well, looks easy enough, got it!

That will be great if that option will be exposed in the next version, could be very handy.
Reply