当前位置:网站首页>X-ray normal based contour rendering
X-ray normal based contour rendering
2022-07-03 04:19:00 【uniGame】
result
principle :
Calculate the rendered color based on the normal of the object surface . Compare the direction of the normal of the object surface with the direction of the line of sight
The closer the normal direction is to the camera direction , Explain the position closer to the center of the object ,
conversely , Indicate the position at the edge
Key code :
v2f vert (appdata_full v)
{
v2f o;
o.pos = mul(UNITY_MATRIX_MVP,v.vertex);
o.viewDir = normalize(TransformWorldToObject(GetCameraPositionWS()));
o.normal = v.normal;
return o;
}
float4 frag (v2f i) : COLOR
{
float rim = 1 - saturate(dot(i.viewDir,i.normal ));
float4 color = _RimColor*pow(rim,_RimPower);
return color;
}
边栏推荐
- Fcpx template: sweet memory electronic photo album photo display animation beautiful memory
- CVPR 2022 | 大連理工提出自校准照明框架,用於現實場景的微光圖像增强
- Interface embedded in golang struct
- [set theory] set concept and relationship (true subset | empty set | complete set | power set | number of set elements | power set steps)
- js/ts底层实现双击事件
- sklearn数据预处理
- Mila、渥太华大学 | 用SE(3)不变去噪距离匹配进行分子几何预训练
- Preliminary cognition of C language pointer
- [set theory] set concept and relationship (set family | set family examples | multiple sets)
- [no title] 2022 chlorination process examination content and free chlorination process examination questions
猜你喜欢
Causal AI, a new paradigm for industrial upgrading of the next generation of credible AI?
【刷题篇】多数元素(超级水王问题)
Basic MySQL operations
300+ documents! This article explains the latest progress of multimodal learning based on transformer
Competitive product analysis and writing
[brush questions] connected with rainwater (one dimension)
中移物联网OneOS与OneNET入选《2021年物联网示范项目名单》
JS realizes lazy loading of pictures
[literature reading] sparse in deep learning: practicing and growth for effective information and training in NN
智能合约安全审计公司选型分析和审计报告资源下载---国内篇
随机推荐
Application of I2C protocol of STM32F103 (read and write EEPROM)
Introduction of pointer variables in function parameters
因果AI,下一代可信AI的产业升级新范式?
ZIP文件的导出
sd卡数据损坏怎么回事,sd卡数据损坏怎么恢复
220214c language learning diary
Mila、渥太华大学 | 用SE(3)不变去噪距离匹配进行分子几何预训练
[set theory] ordered pair (ordered pair | ordered triple | ordered n ancestor)
Mutex and rwmutex in golang
Esp32 series (3): GPIO learning (take simple GPIO input and output, ADC, DAC as examples)
vulnhub HA: Natraj
leetcode:297. Serialization and deserialization of binary tree
The 10th China Cloud Computing Conference · China Station: looking forward to the trend of science and technology in the next decade
js/ts底层实现双击事件
Social phobia of contemporary young people (III)
BMZCTF simple_ pop
How to connect WiFi with raspberry pie
Preliminary cognition of C language pointer
[graduation season · aggressive technology Er] Confessions of workers
[brush questions] find the number pair distance with the smallest K