《Unity 5.x Shaders and Effects Cookbook》第一章学习笔记

写在前面

因为在unity shader方面我并不算是新手了,之前也曾拜读过冯乐乐女神的《unityshader入门精要》,所以觉得第一章其实是很基础的知识,与我自己而言,我觉得第一章的一共有四个重点知识需要我们搞清楚。

知识点一

All the objects that are part of a game contain a number of components that affect their look and behavior. While scripts determine how objects should behave, renderers decide how they
should appear on the screen. Unity comes with several renderers, depending on the type of
object that we are trying to visualise; every 3D model typically has MeshRenderer. An object
should have only one renderer, but the renderer itself can contain several materials. Each
material is a wrapper for a single shader, the fnal ring in the food chain of 3D graphics. The
relationships between these components can be seen in the following diagram:
大意就是游戏中的每个物体都包含一些组件,这些组件决定它的行为和外表,脚本决定行为,而渲染决定它怎么呈现在屏幕上。每一个3D模型都有 MeshRenderer,一个物体只能有一个渲染器,但是一个渲染器可以包含多个材质。他们的关系如下表:

这里写图片描述
知道他们之间的关系对了解shader工作原理很重要。我认为我们还可以更进一步了解下shader和渲染管线的相关知识Shader和渲染管线(个人认为这篇博文讲的比较浅显易懂)

知识点二

如何创建一个shader并且运用到gameobject上,废话不多说,直接上步骤,我的开发环境是unity2017.3.1
step 1:在场景中创建一个cube
step 2:创建一个shader,命名为“StandardDiffu

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值