Project

General

Profile

« Previous | Next » 

Revision c1a38ba3

Added by Leszek Koltunski almost 6 years ago

Progress with non-postprocessed OIT.

Status: compiles, but fails to work on both Adreno and Mali. Crashes the app (Adreno) or the whole system (Mali)

View differences:

src/main/res/raw/oit_build_fragment_shader.glsl
95 95

  
96 96
void main()                    		
97 97
  {
98
  vec4  frag = texture(u_Texture     , v_TexCoordinate);
98
  vec4  color= texture(u_Texture     , v_TexCoordinate);
99 99
  float depth= texture(u_DepthTexture, v_TexCoordinate).r;
100 100

  
101
  if( frag.a > 0.95 )
101
  if( color.a > 0.95 )
102 102
    {
103 103
    gl_FragDepth = depth;
104
    fragColor    = frag;
104
    fragColor    = color;
105 105
    }
106 106
  else
107 107
    {
108
    if( frag.a > 0.0 )
108
    if( color.a > 0.0 )
109 109
      {
110 110
      const float S= 2147483647.0; // max signed int. Could probably be max unsigned int but this is enough.
111
      insert(v_Pixel, uint(S*(1.0-depth)/2.0), convert(frag) );
111
      insert(v_Pixel, uint(S*(1.0-depth)/2.0), convert(color) );
112 112
      }
113 113
    discard;
114 114
    }

Also available in: Unified diff