当前位置:网站首页>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 .
边栏推荐
- konva系列教程4:图形属性
- Is it safe to open a stock account at present? Can I open an account online directly
- Differential equations of satellite motion
- How does a two character name become a three character name with spaces
- MCS:离散随机变量——几何分布
- CKS CKA CKAD 将终端更改为远程桌面
- Query function of Excel vlookup
- Informatics Olympiad 1001:hello, world!
- Differences between @resource and @autowired annotations automatically injected:
- 又拍云 Redis 的改进之路
猜你喜欢

Query function of Excel vlookup

PostgreSQL learning (based on rookie course)

The 5th China software open source innovation competition | opengauss track live training

Unity C# 基础复习28——带返回的委托(P449)

Uniapp problem list and experience

SOFARegistry 源码|数据同步模块解析

EMC surge protection and decoupling design

阿尔兹海默病智能诊断

curl: (56) Recv failure: Connection reset by peer

Solution to the problem that the assembly drawing cannot be recognized after the storage position of SolidWorks part drawing is changed
随机推荐
Redis installation in windows and Linux Environment
ModStartBlog 现代化个人博客系统 v5.2.0 主题开发增强,新增联系方式
Konva series Tutorial 4: drawing attributes
phpcms打开后台首页时向官网发送升级请求觉得卡怎么办?
MCS:离散随机变量——Hyper Geometric分布
Analysis of constant current source circuit composed of two NPN tubes
Trigonometric function corresponding to drawing circle on plane coordinate
熊市慢慢,Bit.Store提供稳定Staking产品助你穿越牛熊
信息学奥赛一本通2062:电影票
Huali biology rushes to the scientific innovation board: the annual revenue is RMB 226million and it is planned to raise RMB 800million
广州期货正规吗?如果有人喊你用自己的手机登,帮忙开户,安全吗?
I log in to the RDB database and prompt that the master account authorization is required. How do I know who to call?
Chapter 11 of canvas canvas status
Differences between @resource and @autowired annotations automatically injected:
Is 100W data table faster than 1000W data table query in MySQL?
中国软冰淇淋市场预测与投资前景研究报告(2022版)
信息学奥赛一本通1001:Hello,World!
JS will have variable promotion and function promotion
Evaluation index of high concurrency software (website, server interface)
Lumiprobe 活性染料丨杂染料:BDP FL 神经酰胺