sabresaurus / SabreCSG

Level design tools for Unity
MIT License
1.38k stars 136 forks source link

Light and Shadow Effect #196

Closed lai0yu closed 5 years ago

lai0yu commented 5 years ago

Unity 2017.4.3f1, SabreCSG 1.7.2.

I created a new scene and created a cube with the UnityEdtior tool to give the SabreCSG default material;

e da grrj0 hki18 xmib

After run I got this effect. 5hedvz e6ckv2 as m_n mc

But I use the same scene and created a cube with SabreCSG, but I got this effect, image image

I am confused about this, because I didn't find the lighting settings in the two scenes and the material shader of the cube. However, the gap between light and shadow is so great, and scenes created using SabreCSG have not been able to restore Unity's default scene lighting effects even after removing SabreCSG-related objects. I hope to use SabreCSG to create objects but get the default lighting effects with UnityEditor, please help me.

Henry00IS commented 5 years ago

This isn't necessarily SabreCSG exclusive, open up the "Window -> Lighting -> Settings" window and press the generate lighting button:

image

The problem is that it doesn't have any reflection probes so reflections don't work, so it just defaults to black and darkness.

lai0yu commented 5 years ago

Thank you, It works for me! But I have another question, I used the SabreCSG code to dynamically create some objects, and the reflections of those objects doesn't work in runtime. Does the Unity engine have no way to perform the same light reflection calculation as baking in runtime ?

vertxxyz commented 5 years ago

Dynamic objects have their reflections calculated using Reflection Probes. https://docs.unity3d.com/Manual/UsingReflectionProbes.html https://docs.unity3d.com/Manual/class-ReflectionProbe.html Objects also need to be tagged appropriately as static to render into the probes.

And their lighting is often calculated with Light Probes. https://docs.unity3d.com/Manual/LightProbes.html https://unity3d.com/learn/tutorials/topics/graphics/probe-lighting?playlist=17102 Which bake lighting information into 3D space.

Realtime shadows can apply shadows on top of both of these.

The details of all the above can also depend on what render path or scriptable render pipeline you are using.

Henry00IS commented 5 years ago

Can this issue be closed? 😀

lai0yu commented 5 years ago

Yes! 😀