How can I make a faded-colored border shadow?

Hi and welcome to the Community,
I am not sure what you mean by “a faded-colored border shadow”. Could you be a bit more explicit.
Do you want to just smooth the shadow? Or do you want to create a shadow faded border of a different color? The first one is easilly achieved from the shadowGenerator. The second one depending on the desired result might require the creation of a shader or using the node material editor.

I tried something with a plugin material and modifying the way the shadow is computed (done only for the “no filter” filter in the PG) but it’s not very conclusive:

The effect depends on the position of the object in the shadow map and relies on some constant (sizeFactor in the code) being tweaked properly. Also, it only works if there’s a single object that casts a shadow on the receiver because it uses the projection of the center of the object in the 2D shadow map for the calculation.

thanks for reply! probably the first one! you can checkout the sketchfab,its a feature of this website to edit a model. you can control border fade of the shadow! if you know how to handle this,please tell me! thanks for help :grin:

thanks so much for your help! I tried in my project , but it doesnt work…
I dont know why

the more Border Fade you set , the more part of the shadow will be faded

probably my object is not a single mesh but a model contains a lot of mesh

Maybe you can try modifying the shadowGenerator.frustumEdgeFalloff property.

2 Likes

Just for my understanding, is this something you want to implement as a dynamic function? Or do you just need to ‘smooth’ the shadow of a given object (hardcoded). The smoothing of the shadow can be achieved through a number of parameters. It goes from the light angle to the minZ and maxZ of the shadowGenerator also using contact hardening. Plus a number of other parameters. Putting these together to achieve the shadow you want for an object (or a set of objects) is ez. Turning this into a dynamic function such as your editable won’t be a piece of cake. There are just a lot of factors starting with the distance of the objects towards where the shadow is casted, the angle of the light, the direction and the list goes on.

1 Like

thank u ! It actually works

1 Like

thank you. I will try it