家园2吧 关注:29,655贴子:719,789

回复:求 如何在导入模型的时候加载法线贴图

只看楼主收藏回复


Essentially each fragment program is called in turn and the results of each stage are blended into the destination buffer.
The ship shaders
-----------------
For medium to far distances rendering is performed with ship.st. This is a simple, single fragment program script which does not render shadows.
For close distances shiplight.sh is run first (if shadows are enabled) to calculated the shadow map and the lighting from light 0. shipadditivelight.st. is the run with the results of the shiplight.sh shader sitting in the destination buffer. This then adds the contribution from any additional lights and multiplies the whole lot with the base colour textures.
Notes on ship detail shaders:
-----------------------------
The lighting shaders (shiplight.st, badgelight.st, thrusterlight.st etc...) are run first placing their results in the output buffer. In normal HW2 this stage performs the shadow and main light calculations, but does not include the base ship colour. All light calculations for the main light are passed to the shaders.
The additional light shaders (shipadditivelight.st, badgeadditivelight.st, thrusteradditivelight.st etc...) run second and combine additional lights, the colour pass and fog with the results of the light shaders to create the final shading. All light calculations for the additional lights (non-main) are passed to the shaders.
When modifiying the lighting shaders you must never texturebind a texture to texture unit 0 (ie textureBind 0 $diffuse) as this will overwrite the shadow trexture calculated and passed by the HW2 executable. The effect will be to destroy the shadow map for subsequent passes. The shading will therefore become corrupted.
It appears that the badge or mask texture textures can not be passed to the light shaders. Therefore badges can not be per-pixel shaded with a bright specular.
You are limited to 4 textures per shader. 3 for the *light.st shaders due to texture unit 0 being used by the shadow texture.
他们还有文件分享,不过那个要装一个叫做TortoiseSVN的客户端才能下载~会使用你硬盘里的一个文件夹来同步~


32楼2012-02-07 11:37
回复
    鄙视....度娘这破烂海外访问太纠结了...
    http://forums.relicnews.com/showthread.php?191374-Homeworld2-
    这里.....其实Complex的论坛上就有连接...他们准备引入这个shader了....
    不过,英文内容非常多.英文苦手的话,似乎很勉强喔~内容太多发不出来了...


    33楼2012-02-07 11:39
    回复
      广告
      立即查看
      法线。。能吃么


      IP属地:山东34楼2012-02-08 12:45
      回复