Any views expressed within media held on this service are those of the contributors, should not be taken as approved or endorsed by the University, and do not necessarily reflect the views of the University in respect of any particular issue.

Materails

I performed UV unwrapping on a 3D model in Maya and subsequently imported it into Substance Painter software to facilitate texture map creation. By utilizing the smart brush tool, I was able to paint and modify the textures, resulting in a material that is not only more realistic and lively, but also offers improved control over texture details and aesthetics.

The use of shaders

standard surface shader

I have implemented a custom surface shader in Unity that creates a basic transparent material, allowing for texturing with the _MainTex parameter and adjustment of transparency. The shader is set to render in transparent cutout mode, which clips out the transparent areas of the material and only displays the opaque regions. Additionally, this shader uses the Lambert lighting model and supports shadows from all types of light sources, achieving more realistic lighting for each pixel. This code has been applied to objects such as tree leaves, bushes, flowers, mushrooms, and other foliage in the scene, resulting in improved visual quality.

Shader Graph:The effect of tree leaves moving with the wind.

This code segment implements wind blowing and shaking effects on tree leaves using Shader Graph, including vertex animation and UV animation. Firstly, texture and color properties are added to the material, and double-sided rendering is enabled. The overall displacement of the tree leaves and the shaking of each leaf’s texture are achieved through node connections, where vertex displacement is implemented by sampling simple noise and adding a continuous changing offset. The size and direction of vertex displacement are controlled by adding wind direction, wind speed, and wind strength parameters. The shaking of leaf texture is achieved by sampling simple noise and adding a continuous changing UV offset, where the amplitude of the shaking is controlled by adding the wind speed parameter. Finally, the nodes are organized and saved to achieve the effect of wind blowing and shaking tree leaves.

Click the link to view the effect:https://youtu.be/NnMwJBNFO8g

Node: Texture

This node implementation facilitates the application of texture and color mapping on the material of the tree leaves, while also implementing advanced features such as double-sided rendering, alpha culling, and the blending of texture and color properties, resulting in the successful depiction of the tree leaves’ shape. By incorporating a texture 2D and color property, developers can gain control over the tree leaves’ texture and color, and by utilizing the node connection method present in Shader Graph, the texture and color can be effectively blended, and various parameters – including alpha culling and smoothness – can be fine-tuned to produce the desired outcome.

Node:Wind blowing leaves effect

This node implementation enables the effect of wind blowing and shaking tree leaves, consisting of two parts: vertex animation for overall displacement of the leaves, and UV animation for the shaking of each leaf’s texture. The vertex animation involves adding the vertex displacement to the vertex position to move the tree leaves as a whole, using the XZ of the vertex’s world coordinates as UV, and adding a continuously changing offset. A noise map is then sampled to obtain the vertex displacement in world space. The UV animation is achieved by using the XZ of the vertex’s world coordinates as UV, adding wind direction multiplied by wind speed and time, to obtain a continuous changing offset, thus creating the shaking effect of each leaf’s texture. Finally, the vertex offset is added to the vertex’s world space position, and the vertex’s world space position is transformed into object space using a transform node to achieve the effect of wind blowing and shaking tree leaves.

Node: leaf texture dithering effect

This piece of code utilizes simple noise and rotation nodes to create a jitter effect on the texture of the leaves. Specifically, the implementation involves multiplying the output of the noise node by the rotation amplitude, and then connecting the rotated UV coordinates to the texture node, resulting in the jitter effect on the leaf texture. The amplitude of the jitter effect is controlled by the wind speed, where the value of wind speed determines the strength of the jitter effect, and can be adjusted to control its intensity.

Shader: Grass

The paragraph describes modifications made to a shader used for rendering grass in a scene. The modifications include removing the wiggleOffset float variable, which enables the grass blades to sway within a range of negative and positive values, and adding two color properties, namely Top Color and Bottom Color, to the shader. The Vertex Color node is used to control the color transition. Additionally, a Main Light node is created by multiplying the Shadow Attenuation and Self Shadowing nodes, which respectively represent the grass’s own shadow and shadows cast by other objects. The resulting color is connected to a Sample Gradient node, which is adjusted to a half-deep green and half-black gradient. Another Sample Noise node is added and modified to a half-black and half-white gradient, which is used to mask the grass color and add to the shadow color. The final result is used as the base color for the grass, enhancing its lighting and color and creating a more realistic and visually appealing effect.

Node:MainLight

The Main Light subgraph is used to extract information about the main light source in a game scene, such as direction, color, intensity, range, and more. In game scenes, it is necessary to calculate lighting and shadows for objects based on the direction, position, and color information of the main light source. Therefore, the Main Light subgraph also includes a shadow map sampling node to extract shadow information from the scene’s shadow map for rendering and projecting shadows onto objects in the scene. The Main Light subgraph allows for convenient access to information about the main light source, resulting in more realistic lighting and shadow effects in the scene.

Leave a Reply

css.php

Report this page

To report inappropriate content on this page, please use the form below. Upon receiving your report, we will be in touch as per the Take Down Policy of the service.

Please note that personal data collected through this form is used and stored for the purposes of processing this report and communication with you.

If you are unable to report a concern about content via this form please contact the Service Owner.

Please enter an email address you wish to be contacted on. Please describe the unacceptable content in sufficient detail to allow us to locate it, and why you consider it to be unacceptable.
By submitting this report, you accept that it is accurate and that fraudulent or nuisance complaints may result in action by the University.

  Cancel