随笔 - 505  文章 - 1034  trackbacks - 0
<2008年3月>
2425262728291
2345678
9101112131415
16171819202122
23242526272829
303112345


子曾经曰过:编程无他,唯手熟尔!

常用链接

留言簿(94)

随笔分类(649)

随笔档案(505)

相册

BCB

Crytek

  • crymod
  • Crytek's Offical Modding Portal

Game Industry

OGRE

other

Programmers

Qt

WOW Stuff

搜索

  •  

积分与排名

  • 积分 - 903792
  • 排名 - 14

最新随笔

最新评论

阅读排行榜

评论排行榜


总是想看点新鲜的东西,或许是因为生活太单调了。

大体看了下《用RenderMonkey 进行shader开发》,学了点皮毛。

要真正理解这玩意儿,还得看DirectX Documentation.

Shaders

At a very high level, data enters the graphics pipeline as a stream of primitives and is processed by up to as many as three shader stages:

  • A vertex shader performs per-vertex processing such as transformations, skinning, vertex displacement, and calculating per-vertex material attributes. Tessellation of higher-order primitives should be done before the vertex shader executes. As a minimum, a vertex shader must output vertex position in homogeneous clip space. Optionally, the vertex shader can output texture coordinates, vertex color, vertex lighting, fog factors, and so on.
  • A geometry shader performs per-primitive processing such as material selection and silhouette-edge detection, and can generate new primitives for point sprite expansion, fin generation, shadow volume extrusion, and single pass rendering to multiple faces of a cube texture.
  • A pixel shader performs per-pixel processing such as texture blending, lighting model computation, and per-pixel normal and/or environmental mapping. Pixel shaders work in concert with vertex shaders; the output of a vertex shader provides the inputs for a pixel shader. In Direct3D 9 some pixel operations (such as fog blending, stencil operations, and render-target blending) occur after the pixel shader is finished.

These stages are completely programmable using the High Level Shading Language (see HLSL). Authored HLSL shaders can be compiled at author-time or at runtime, and set at runtime into the appropriate pipeline stage.

All Direct3D 10 shaders are compiled with the shader model 4 target. Functions like D3D10CompileShader and D3D10CompileEffectFromMemory require a shader profile to tell the compiler which shader model to compile for.

posted on 2007-10-21 04:11 七星重剑 阅读(1294) 评论(0)  编辑 收藏 引用 所属分类: Game GraphicsHLSL&ShaderMonkey

只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理