mc光影吧 关注:8,585贴子:130,319
  • 2回复贴,共1

OptFine中composite, gaux1, gaux2..这些uniform有什么区别?

只看楼主收藏回复

IP属地:上海1楼2018-10-03 20:50回复
    其中有这么一段
    In the deferred, composite and final shaders, these are referenced by the gcolor, gdepth, gnormal, composite, gaux1, gaux2, gaux3 and gaux4 uniforms
    (colortex0 to colortex7 can be used instead of gcolor, gdepth etc.)
    Despite the naming, all of these color attachments are the same and can be used for any purpose with the exception of the first two.
    The first one, gcolor has its color cleared to the current fog color before rendering.
    The second one, gdepth has its color cleared to solid white before rendering and uses a higher precision storage buffer suitable for storing depth values.
    The rest have their color cleared to black with 0 alpha.
    Deferred and composite programs use ping-pong buffers to pipe the output of one program as input to the next one.
    When needed one last deferred or composite program may be added automatically to even out the flipped ping-pong buffers.
    This allows them to read and write from and to the same buffer alias.
    这个意思是不是说在composite.vsh 的shader中, 这里输入的值会在后面的渲染过程中用到?
    但是这已经是fragment shader 了 后面的流程似乎控制不到了


    IP属地:上海2楼2018-10-03 20:55
    回复
      我看到的一个shader里面就有很多
      texture2D(gnormal, texcoord).rgb;
      OR
      texture2D(composite, texcoord).rgb
      OR
      texture2D(gaux1, texcoord).rgb
      但是我不懂这些sampler 有什么区别
      Source Value
      =====================================================================================================================================================================
      uniform sampler2D gcolor; 0
      uniform sampler2D gdepth; 1
      uniform sampler2D gnormal; 2
      uniform sampler2D composite; 3
      uniform sampler2D gaux1; 7
      uniform sampler2D gaux2; 8
      uniform sampler2D gaux3; 9
      uniform sampler2D gaux4; 10


      IP属地:上海3楼2018-10-03 20:59
      回复