当前位置:网站首页>Unity shader learning (II) the first shader
Unity shader learning (II) the first shader
2022-06-27 11:18:00 【ToDoNothing】
As in the previous section , Create a shader, In this section, we will try to output a color to the material , The code is as follows :
Shader "Unlit/shader2"
{
// Parameter variable
Properties
{
}
SubShader
{
Tags {
"RenderType"="Opaque" }
LOD 100
Pass
{
// Rendering starts
CGPROGRAM
// Define vertex shaders
#pragma vertex vert_img
// Define the slice shader
#pragma fragment frag
// introduce unity Defined content
#include "UnityCG.cginc"
// Slice shader functions
// Enter information about a vertex
//v2f_img by unity A pre written structure , You can use it directly
//SV_TARGET:SV_ by system value It means ,SV_Target yes DX10+ be used for fragment The semantics of the function shader's color output . Use it to finish it
// Return to one fixed4 Quaternion vector , It's actually a color parameter, that is RGBA, The range of values is -1——1
fixed4 frag (v2f_img i) : SV_Target
{
return fixed4(1,0,0,1);
}
// End of rendering
ENDCG
}
}
}
v2f_img Source code
The effect is a red material , No lighting information
Change it return Value , To blue
边栏推荐
- 杰理之无缝循环播放【篇】
- Go zero micro Service Practice Series (VII. How to optimize such a high demand)
- Proe/Creo家电产品结构设计规范-电煎锅
- 20 jeunes Pi recrutés par l'Institut de microbiologie de l'Académie chinoise des sciences, 2 millions de frais d'établissement et 10 millions de fonds de démarrage (à long terme)
- Metadata of database
- Challenges of machine learning system in production
- 15+城市道路要素分割应用,用这一个分割模型就够了!
- “互联网+”大赛命题火热对接中 | 一图读懂百度38道命题
- One copy ten, CVPR oral is accused of plagiarizing a lot
- 21: Chapter 3: develop pass service: 4: further improve [send SMS, interface]; (in [send SMS, interface], call Alibaba cloud SMS service and redis service; a design idea: basecontroller;)
猜你喜欢
Red envelope rain: a wonderful encounter between redis and Lua
Leetcode 522 longest special sequence ii[enumeration double pointer] leetcode path of heroding
Glide caching mechanism
【TcaplusDB知识库】TcaplusDB单据受理-创建业务介绍
[tcapulusdb knowledge base] tcapulusdb doc acceptance - table creation approval introduction
KDD 2022 | epileptic wave prediction based on hierarchical graph diffusion learning
How to deploy jupyterlab in methodot?
Code for structural design of proe/creo household appliances - electric frying pan
Write it down once Net analysis of a property management background service stuck
一篇抄十篇,CVPR Oral被指大量抄袭
随机推荐
.NET6接入Skywalking链路追踪完整流程
deep learning statistical arbitrage
飞桨产业级开源模型库:加速企业AI任务开发与应用
Jerry's serial port communication serial port receiving IO needs to set digital function [chapter]
直播電子商務應用程序開發需要什麼基本功能?未來發展前景如何?
【TcaplusDB知识库】TcaplusDB运维单据介绍
Prevent being rectified after 00? I. The company's recruitment requires that employees cannot sue the company
深入理解 happens-before 原则
Istio related information
Codeforces Round #786 (Div. 3) ABCDE
[tcapulusdb knowledge base] tcapulusdb doc acceptance - table creation approval introduction
Oracle multi table query
Jerry's seamless looping [chapter]
Leetcode 729. 我的日程安排表 I(提供一种思路)
go-zero微服务实战系列(七、请求量这么高该如何优化)
Oracle-分组统计查询
Working at home is more tiring than going to work at the company| Community essay solicitation
Co jump
KDD 2022 | 基于分层图扩散学习的癫痫波预测
Summary of qstype class usage (III)