5.10 recombinant shaders--game programming gems 笔记

这个可以说是一个游戏渲染部分非常核心的部分。

game programming gems 5开这个专题是非常有意义的。

shader linker反映了整个引擎的data pipeline的结构:

所支持渲染的宽度,深度和灵活性。

具体做法是首先定义所支持的渲染方式,这些当然是反映到物体的属性和材质上:

lighting--per-pixel, per-vertex, 全局光模型,normal/parallax map等

texture: 各种mask,animated,

这一切都最后反映到vertex shader和pixel shader上。

根据所支持的渲染技术,写出对应的各个部分,比如parallax map的实现,光照模型,都放在一个个小函数里面,然后在根据现在游戏中有的类型进行组合,进而形成一个个完整的shader。

把shader和材质类型map起来。

map肯定就是有hash的key和value,一般也就是把uint32或者uint64中的每个bit与具体材质信息对应起来,那么转成字符串就成了shader的名字。

这样就完成了map过程。

 

由于这种做法带来了巨大的通用性,相应的,它对于设计和后期的调试打磨就有更高的要求。

这个方法的确非常cool!

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
是一本中文扫描版。 Publication Date: January 22, 2008 Welcome to the seventh volume of the must-have reference series for game developers, Game Programming Gems, the series that helped define the standards for game programming and continues to be an essential source for new, innovative techniques. "Game Programming Gems 7" provides the tools and inspiration that game developers need to excel. Featuring cutting-edge, ready-to-use techniques contributed by industry veterans and experts, this new collection is a key resource for inspiration, insight, and a plethora of time-saving, ready-to-use methods for the developer's tool box! Gems 7 answers the needs of passionate developers, eager newcomers, voracious production requirements, and the demand for innovating and entertaining gameplay. Covering all the key development areas including math and physics, artificial intelligence, audio, and even scripting and data-driven systems, each section is edited by an expert in the field to ensure that the ideas are original, accurate, and useful.There are gems that contribute directly to a player's experience of the game, including audio production gems and human-game interactions. Does your development team include a DBA? Inside you'll find a gem that suggests ways to integrate your object system with a relational database. Recognizing the need for good solutions for managing ever-increasing team sizes and facilitating efficient internal and external communications, there is a networking gem that applies tools to multiplayer development that are common to many network administrators, but may not yet have widespread use in our industry. Dig into this new volume of useful, practical ideas and techniques and get ready to make games that are more inventive, entertaining, and satisfying!
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值