Shaders Properties in Unity: A Brief Introduction

Unity, one of the most popular game development platforms, offers a versatile and powerful tool called shaders. Shaders are essential components in creating visually stunning and realistic graphics in Unity games. In this article, we will explore the concept of shader properties and their importance in game development.

Shaders, in simple terms, are programs that define how the graphics on the screen are rendered. They determine the colors, textures, and lighting effects that make up the visual aspects of a game. However, shaders require various input parameters to create customizable and dynamic visuals. This is where shader properties come into play.

Shader properties allow developers to expose certain variables or parameters of a shader to Unity’s Inspector window. These properties act like user-friendly controls that can be adjusted to tweak the appearance of the game objects that use the shader. By modifying shader properties, developers can alter the behavior of the shader and create visually diverse and unique effects.

The properties can be of different types, such as integers, floats, vectors, colors, textures, or even custom data types. Each property is associated with a unique name and a default value, which can be overridden by the user or scripted to change dynamically during gameplay.

example

For example, consider a shader for a car model in a racing game. The shader might have properties like “Color,” “Specular Intensity,” “Texture,” and “Tiling & Offset.” These properties would allow the game designer to adjust the color of the car, control the shininess of the car’s surface, apply a specific texture to the car’s body, and manipulate the tiling and offset of the texture for more realistic rendering.

The power of shader properties lies in their ability to promote reusability and flexibility. By exposing certain parameters, developers can create a single shader that can be easily customized for different game objects. This saves time and effort by eliminating the need to create multiple similar shaders from scratch.

Moreover, you can access shader properties and modify them through scripts, allowing for dynamic alterations during gameplay. This opens up a world of possibilities, enabling effects like color-changing materials, interactive lighting, and more. By tweaking shader properties in real time, developers can create immersive and interactive experiences for players.

In conclusion, shader properties are an indispensable tool for developers working with shaders in Unity. They provide a means to adjust and fine-tune the appearance of game objects, making them visually appealing and captivating. By utilizing shader properties effectively, developers can create stunning visuals and deliver an immersive gaming experience. So, dive into the world of shaders and start exploring the endless possibilities they offer!

Terms used in Unity Games Part 10

Unwrap in unity:-

Terms used in Unity games part 10 मे हम लोग सबसे पहले Unwrap को देखेंगे । 

Unwrap का मतलब होता है कि कोई भी फ्लैट टेक्सचर मॉडल पर कैसे लपेटा  जाएगा । 

यहां पर जो सबसे इंपोर्टेंट बात ध्यान रखने लायक है वह यह है कि जैसे किसी मॉडल पर आपको कोई टेक्सचर लपेटना है। 

तो उसे आपको यह ध्यान रखना पड़ेगा कि मॉडल के ऊपर टेक्सचर को किस तरीके से लपेट जाना है।  

क्योंकि अगर लपेटने का डायरेक्शन ठीक नहीं होगा तो मॉडल पर यह टेक्सचर अच्छे से बैठ नहीं पाएगा।  

इसके बाद शेडर्स और टेक्सचर में बेसिक अंतर को देख लेते हैं। 

तो वह जहां टेक्सचर बताता है कि मॉडल पर क्या ड्रा किया जाए वहीं शेडर्स बताता है कि इसे कैसे ड्रॉ किया जाए। 

मेष , शेडर्स और टेक्सचर:-

unity interface showing game object with materials and mesh terms used in unity.
unity interface showing game object with materials and mesh

मेष , शेडर्स और टेक्सचर को एक एग्जांपल से समझ सकते हैं जैसे कि कोई लकड़ी अस्तित्व में है यानी कि वह mesh  है और इसके कलर, टेक्सचर और अन्य विजुअल एलिमेंट्स इसके टेक्सचर होते हैं और जब लकड़ी को भीगा दिया जाए तो सूखी लकड़ी और भीगी लकड़ी उसके शेडर्स को बताती है। 

मैटेरियल्स कंटेनर्स की तरह होते हैं। जो की टेक्सचर और शेडर्स को कंटेन करके रखते हैं 

Terms used in Unity games part 10 के अंत मे कुछ शेडर्स प्रॉपर्टीज को देख लेते हैं ➖

Albedo:-

मोडेल की कलर इनफार्मेशन टेक्स्चर मे होती है। 

इसलिए आप albedo पर टेक्स्चर सेट कर सकते हैं।  

क्यों की albedo प्रॉपर्टी ऑब्जेक्ट model के base कलर को ही बताता है। 

Metalic

ये प्रॉपर्टी मेटालिक और मटीरीअल looks को बताती है। 

smoothness :

ये property model को less या more shiney बनाता है। 

नॉर्मल मॅप:

मोडेल मे और ज्यादा डिटेल्स डालने के लिए लाइट का कैल्क्यलैशन किया जाता है। 

जिसके लिए इसी नॉर्मल मॅप का इस्तेमाल होता है। 

Tiling :

ये प्रॉपर्टी बताती है की कब कब टेक्स्चर मोडेल पर रीपीट होना चाहिए।

Continue ReadingTerms used in Unity Games Part 10