Garment Rendering Setting
发布于:2024-11-21
Operating Instructions
1. Cast shadow
Cast Shadow, used to set whether or not a model object produces cast shadows in lighting that appear on the surfaces of other objects in the scene (such as models). Enabling "Cast Shadow" will allow this object to cast shadows under lighting conditions.
Enabling Cast Shadow Situations:
Cast Shadow not enabled:
It is obvious that with "Cast Shadow" enabled, under the same lighting, the projections of the dress's ribbons and folds are more detailed, making the dress look more realistic.
However, in some cases, it is possible to improve game performance by disabling cast shadow on certain objects. Especially for objects that are far from the field of view, where their shadows may be less important, disabling cast shadows can reduce the rendering load.
In UE light tracing mode, you need to set r.RayTracing.Shadows.EnableTwoSidedGeometry 0 to avoid two-sided shadows
2. Dynamic shadow
Dynamic Shadow typically refers to shadows that are generated and updated at runtime to reflect real-time lighting changes in the scene. Dynamic shadows are usually associated with dynamic light sources, including light sources such as PointLight that can change position and direction at runtime.
First, start by setting up a PointLight position
With Dynamic Shadow turned on:
Without Dynamic Shadow turned on:
Change the position of the PointLight and leave everything else the same:
With Dynamic Shadow turned on:
Without Dynamic Shadow turned on:
The dynamic shadows change when the PointLight changes, and that they change in size depending on the angle between the light source and the garment.
Dynamic shadow, which are solved and updated at runtime, allow the engine to respond more flexibly to the movement of light sources, objects, and the camera. Dynamic shadows are suitable for scenes that require real-time interaction, such as character movement, light movement, or weather changes.
3. Hidden shadow
Hidden Shadow needs to be used at the same time as the Hidden in Game.
Enable Hidden in Game first, then check Hide Shadow, no change when not simulating:
After opening the simulation:
The garments are not visible in the simulation, but the shadows created by the garments are still observable. Turning off Hidden Shadow while keeping the hidden property unchanged in the game shows that there are no detailed shadows on the model, as shown in the picture.
It can be applied to refer to a situation where some objects or parts of objects in a scene do not cast shadows.
4. Lighting Channel
Lighting channels are a way to achieve control over lights and objects by assigning them to specific channels, which can be selectively enabled or disabled for lighting or shadows on a particular channel. This provides more control to the game developer, allowing for finer tuning of lighting effects.
The channels on Style3D have to match the channels of the lights in order to show the effects of the corresponding lights. There are now two PointLight in the scene, PointLight1 and PointLight2.
PointLight1 signals white light, far away from the garment, in the Lighting Channel 0; PointLight2 is closer to the garment, signals red light, in the Light channel 1.
First of all, the Lighting Channel in the Style3D component only turns on Channel 0, which is only affected by the PointLight1.
Then, at the same time, turn on the Lighting Channels 0 and 1, you can find the garment brighter, and it shows red light and shadows.
Finally, by turning off Channel 0 and only turning on Channel 1, with the garment only affected by the closer, darker red light of PointLight2.
Lighting Channels are used in a variety of scenes, including situations where you need to have individual control over specific objects or lights. This means that you can selectively apply light to objects on a given channel or exclude shadows on a given channel during the rendering phase.
Light Channels can also be used for performance optimization. Reduce the complexity of rendering by limiting lights to only affect objects on a specific channel, thus improving the performance of your game.
5. Hidden in Game
While the game is running, setting Hidden in Game property is used to hide the component, which is no longer being rendered and not being visible on the screen while the game is in progress.
Style3d component opens Hidden in Game, but not yet started simulated game:
After starting the simulation:
Due to the Hidden in Game property being turned on, you can see that the garmeny on the model is not removed but is not visible. The hidden component helps you to dynamically manage the visible elements of the scene while the game is playing.
6. Translucency Sort Priority
Translucency Sort Priority used to determine the rendering order of transparent objects in the scene.
Attention This value should never be set to a non-default value without knowing exactly what you're doing, otherwise it will prevent the renderer from sorting correctly, and is especially prone to problems with dynamic game effects.
Translucency Sort Distance Offset is the same.