当前位置:网站首页>Summary of introduction to unityshader (2): Beginner Level
Summary of introduction to unityshader (2): Beginner Level
2022-07-29 09:24:00 【Starve fish】
violet : General concepts or brief and powerful summaries
Blue : Subdivide concepts or important parts
Red : Important supplementary notes
The fifth chapter : know UnityShader
Start with the simplest shader structure

A basic code that contains vertex shaders and slice shaders
#pragma Defines the shader type
vertex For the top ,fragment Is a piece element (shader It uses CG grammar )

Among them Fixed4,float4 What does waiting mean ?

Look at an advanced version of the code that links vertex and fragment shaders

If you think it's more winding . You can temporarily treat the colon as " From " understand
float4 vertex : POSITION
Like creating a float4 Variable vertex, It comes from POSITION( Model space vertex coordinates )
This time, vert Returned a v2f Structure rather than float4 了 . And finally frag Also successfully quoted v2f Finish coloring
(vertex.normal It's normal )


Call the property
Attributes are variables that can be changed in the editor interface . Use Properties

Reference directly in the shader

such , A color can be adjusted at any time shader Just do it

边栏推荐
猜你喜欢
随机推荐
基于ArkUI eTS开发的坚果新闻(NutNews)
Axurerp prototype design starts quickly
远程连接windows版本服务器redis的配置文件设置
C # use database to bind listview control data
简述堆和栈的区别
附录2-一些简单的练习
【Unity入门计划】C#与Unity-了解类和对象
高智伟:数据管理赋能交通行业数字化转型
C# 使用RestSharp库实现POST请求
Discussion on the integration of storage and calculation and the calculation in storage
A structured random inactivation UNET for retinal vascular segmentation
No duplicate data in the same field of different databases
STM32 application development practice tutorial: getting to know STM32 for the first time
Travel notes in 2022 (ongoing)
Simple unit testing idea
《UnityShader入门精要》总结(2):初级篇
Use cpolar to publish raspberry pie web pages (improvement of cpolar tunnel)
数据表示与计算(进制)
MySQL converts some table names to uppercase
AI is at the forefront | focusing on natural language processing, machine learning and other fields; From Fudan University, Institute of automation, Chinese Academy of Sciences and other teams

![Acwing game 59 [End]](/img/a6/70d76e78e49dc2ad08084f58750017.png)







