OpenGL custom shader

The purpose of this article is how to use OpenGL to customize Shader. First make sure you can draw forms and triangles: portal Previously, Shader was written directly in the code, which was very inconvenient to use. The general method for projects is to customize the shader file and then read the text content How […]

Preparation of GI related data for Shader in Unity

Article directory Preface 1. Transplant the GI functions used in Unity into our customized cginc file 2. Start using GI-related methods 1. Understand the contents of the UnityGI structure and prepare UnityGI data 2. Understand the SurfaceOutput structure and prepare data 3. Understand and prepare the UnityGIInput structure and prepare its related data This is […]

How to choose Shader based on performance for Unity3D mobile development

Foreword In Unity3D mobile development, it is very important to choose the appropriate Shader, which directly affects the performance and picture effects of the game. This article will introduce how to choose a Shader based on performance, and give corresponding technical details and code implementation. Yes, there is a game development exchangegroup here. I hope […]

Unity ShaderGraph| Create an advanced fluid water ball effect

Preface 【Unity ShaderGraph】| Quickly create a fluid water ball effect 1. Effect display 2. Simple fluid water polo effect 3. Advanced fluid water polo effect 4. Application examples Foreword This article will use ShaderGraph to create an Advanced Fluid Water Polo, which can be used directly in the project. Friends who are not familiar with […]

Model mesh shadow of Shader in Unity

Article directory Preface 1. Grid Shadow Principle 1. In the world space, compress the character model into a patch on the Y axis, and modify the color to resemble the color of the shadow. 2. Move the compressed patch to a suitable position and stagger the model and shadow patch. 3. The shadows that are […]

ShaderLOD of Shader in Unity

Article directory Preface 1. Steps to use ShaderLOD 1. ShaderLOD is used in different SubShaders to distinguish the configuration corresponding to the SubShader. 2. Use Shader.globalMaximumLOD assignment in C# to select different SubShaders to achieve the effect of modifying the configuration corresponding to the Shader. 3. When setting up LOD, you need to discuss with […]

Shader shadow reception in Unity

Article directory Preface 1. Steps for Shadow Acceptance 1. Add UNITY_SHADOW_COORDS (idx) to v2f. Unity will automatically declare a float4 variable called _ShadowCoord, which is used as the sampling coordinates of the shadow. 2. Add TRANSFER_SHADOW(o) in the vertex shader, which is used to transform the _ShadowCoord texture sampling coordinates defined above into the corresponding […]

Dynamic graphics effects implemented by WebGL2 Shader

Article directory Preface renderings Create canvas and WebGL context Set page title and style Define device pixel ratio and window resizing functions Write source code for vertex shader and fragment shader Compile shader functions and create programs Initialize vertex data and buffers Define mouse event handling objects and functions Complete code Summarize Foreword This article […]

Shader shadow casting in Unity

Article directory Preface 1. We urgently need to use the Shader in the previous Offset as a test 2. Generate shadows 1. Add the Pass of “LightMode” = “ShadowCaster”. 2. Declare float4 vertex:POSITION; and half3 normal:NORMAL; in appdata. This is the semantics required to generate shadows. 3. Add V2F_SHADOW_CASTER in v2f; used to declare the […]