当前位置:网站首页>Unity shader learning 004 shader debugging platform difference third-party debugging tools
Unity shader learning 004 shader debugging platform difference third-party debugging tools
2022-06-13 03:57:00 【Dutch pig small ash】
List of articles
Learning time :
2022.5.27
Learning output :
1. debugging Shader
1.1 We turn on FrameDebug window
Frame Debugger Let's observe the rendering process of a frame separately , Observe every DrawCall The rendering of , It will bring DrawCall One by one in order , By clicking on each DrawCall, You can see the execution to this DrawCall Rendering when , Step by step, you can see the whole scene rendering and the very detailed construction process .


1.2 adopt FrameDebug Window view us shader Render the state of the target
For example, here is a forward rendering Cube
1. First Shader yes Unlit/004,SubShader #0 Because of our shader There is only one render channel
SubShader Is a sub shader of the entire shader , When one Mesh( grid ) When it needs to be drawn ,Unity Will be in Shader Find a way to render it , And from Shader Choose the first one that can be fully supported SubShader To achieve . To make the material , Or let the game screen play its best effect on different platforms , We can define more than one SubShader. every last SubShader All contain complete rendering parameters , Render settings , Rendering methods, etc . In the beginning stage , We write a for materials SubShader that will do , We can leave the rest of the work to the powerful FallBack To complete .
2. Then our passage Pass yes #0
3.ZClip Set up GPU Depth clip mode
4.ZTest Deep inspection LessEqual Less than the target
LEqual Draw geometry in front of or at the same distance from existing geometry . Do not draw geometry behind existing geometry .
5.ZWrite: Depth write , When enabled, determines whether the depth value of the slice is written to the depth buffer , Configurable

2. Platform differences
2.1 Anti-Aliasing
Because of us Unity It's cross platform , So there is OpenGL and DirectX Two coordinate systems
Usually ,Unity It will help us turn over automatically
however , If anti aliasing is turned on , that DX platform , You need to manually flip
Unity In this way, anti aliasing is turned on (Anti Aliasing)
The method of manual turnover , Is to first judge whether it is DX platform , Then determine whether anti aliasing is enabled , If all is satisfied , Then flip
[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-YzkCKEBZ-1655041487014)(https://liuwenxin-oss.oss-cn-hangzhou.aliyuncs.com/img/4cbba614e4f348858f2809c17e776dc0.png)]
Pictured ,Unity yes DX platform 
2.2 DX The platform defines variables more strictly

3. Third party debugging tools

边栏推荐
猜你喜欢

USB-IF BC1.2充电协议解读

Single chip microcomputer: main index of a/d (analog-to-digital conversion)

Detailed explanation of MySQL storage process

史上最详细的Swin-Transformer 掩码机制(mask of window attentation)————shaoshuai

单片机:I2C通信协议讲解

基于PHP的轻量数码商城系统
![[test development] automated test selenium (III) -- unittest framework analysis](/img/d2/e03746b20b2b50172e566023f6c224.png)
[test development] automated test selenium (III) -- unittest framework analysis

【 développement d'essais 】 sélénium d'essais automatisés (Ⅲ) - - analyse du cadre unitest

Introduction to MCU peripherals: temperature sensor DS18B20

Interpretation of usb-if bc1.2 charging protocol
随机推荐
Lambda termination operation find and match anymatch
What to bring to 2022
环评图件制作-数据处理+图件制作
footstep
EGO Planner代码解析----CMakeLists.txt和package.xml
UnionPay commerce - merchant statistics service platform
机器人避障系统基础
干预分析 + 伪回归
单片机信号发生器程序
[zeloengine] localization process /imgui Chinese culture
User and permission configuration in SQL Server database to ensure database security
手机私有充电协议解读
Common array methods in JS (map, filter, foreach, reduce)
【多线程】多线程到底是个甚——多线程初阶(复习自用)
Lambda end operation find and match findany
【测试开发】软件测试基础篇
CDN domain name
Installing MySQL 8.0.20 under Linux and ubuntu20.04 LTS
【測試開發】自動化測試selenium(三)——unittest框架解析
LVS四層負載均衡集群(3)集群功能分類 - HPC