当前位置:网站首页>Material dynamic self illumination
Material dynamic self illumination
2022-06-29 15:05:00 【Sunshine in front of heart】
Dynamically modify the material self illumination
- Create a new scene , Turn off the directional light ; Purpose : Self illumination is more obvious
- establish 2 A cube ;
- Create a material ;
- The material is assigned to the two new cubes ;
- Two cube mount scripts .
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class TestEmssion : MonoBehaviour
{
MaterialPropertyBlock block;
Renderer render;
private void Start()
{
block = new MaterialPropertyBlock();
render = GetComponent<Renderer>();
}
private void OnMouseEnter()// Mouse migration Impactor trigger
{
render.GetPropertyBlock(block);
render.material.EnableKeyword("_EMISSION");// Turn on self illumination
block.SetColor("_EmissionColor", Color.blue);// Set the color
render.SetPropertyBlock(block);
}
private void OnMouseExit()// Mouse removal Impactor trigger
{
render.GetPropertyBlock(block);
block.SetColor("_EmissionColor", Color.blue);// Set the color
render.material.DisableKeyword("_EMISSION");// Turn off highlights
render.SetPropertyBlock(block);
}
}
Existing problems
In edit mode , It has a highlight effect . After the release of , No highlights .
resolvent
- Material check Emssion;
- Global Illumination Set to Realtime perhaps None that will do
reason
Global Illumination: Specifies how the light emitted by this material affects the ambient lighting of other nearby game objects .
- Realtime:Unity Set the... Of this material ⾃ Glow added to the scene Realtime Global Illumination( Real time global illumination ) In calculation . It means that ⾃ Lighting affects nearby GameObjects ( Including moving GameObjects ) The light of the sun .
- Baked:Unity Set the... Of this material ⾃ Glow is baked into the static global illumination of the scene . This material affects the lighting of nearby static GameObjects , But it does not affect the lighting of dynamic game objects . however , The illumination probe still affects the illumination of the dynamic GameObject .
- None: Of this material ⾃ Illumination does not affect real-time lightmaps in the scene 、 Bake lightmaps or lightprobes . this ⾃ Glow does not illuminate or affect other GameObjects .
边栏推荐
- curl: (56) Recv failure: Connection reset by peer
- Illustration of Ctrip quarterly report: net revenue of RMB 4.1 billion has been "halved" compared with that before the outbreak
- MCS:离散随机变量——Hyper Geometric分布
- Imitation headline news information DZ template discuz news information business version GBK template source code
- Trigonometric function corresponding to drawing circle on plane coordinate
- 华曙高科冲刺科创板:拟募资6.6亿 实控人许小曙父子均为美国籍
- Yi Ming ang Ke rushed to Hong Kong shares: loss of 730million in the year Lilly and sunshine life insurance were shareholders
- EMC-浪涌防护及退耦设计
- 华为软件测试笔试真题之变态逻辑推理题【二】华为爆火面试题
- 打造一个 API 快速开发平台,牛逼!
猜你喜欢
随机推荐
使用自定义注解实现Redis分布式锁
Lumiprobe 点击化学丨非荧光叠氮化物:叠氮化物-PEG3-OH
Are the top ten domestic securities companies safe?
symfony框架安全组件(security)防火墙配置
wieshark抓包mysql协议简单分析
捷氢科技冲刺科创板:拟募资10.6亿 上汽集团是大股东
Explanation on deployment and establishment of decentraland process
Construction and application of medical field Atlas of dingxiangyuan
Netease strict selection offline data warehouse quality construction practice
[Verilog quick start of Niuke online question series] ~ shift operation and multiplication
Wechat official account - menu
信息学奥赛一本通1002:输出第二个整数
信息学奥赛一本通2062:电影票
Jet hydrogen technology rushes to the scientific innovation board: SAIC Group is the major shareholder to raise 1.06 billion yuan
bash汇总线上日志
Lumiprobe 活性染料丨羧酸:Sulfo-Cyanine7.5羧酸
Indice d'évaluation du logiciel hautement simultané (site Web, interface côté serveur)
华曙高科冲刺科创板:拟募资6.6亿 实控人许小曙父子均为美国籍
Evaluation index of high concurrency software (website, server interface)
二级指针









