Project

General

Profile

« Previous | Next » 

Revision 9a3607b3

Added by Leszek Koltunski about 6 years ago

Fix the preprocess shader. This makes the 'Postprocess Tree' app look good again.

View differences:

src/main/java/org/distorted/library/main/DistortedOutputSurface.java
399 399
///////////////////////////////////////////////////////////////////////////////////////////////////
400 400
// Render all children, one by one. If there are no postprocessing effects, just render to THIS.
401 401
// Otherwise, render to a buffer and on each change of Postprocessing Bucket, apply the postprocessing
402
// to a whole buffer (lastQueue.postprocess) and merge it (this.oitBuild).
402
// to a whole buffer (lastQueue.postprocess) and merge it (this.oitBuild or blitWithDepth - depending
403
// on the type of rendering)
403 404

  
404 405
  int renderChildren(long time, int numChildren, ArrayList<DistortedNode> children, int fbo, boolean oit)
405 406
    {
src/main/res/raw/preprocess_fragment_shader.glsl
29 29
void main()
30 30
  {
31 31
  vec4 color = texture(u_Texture,v_TexCoordinate);
32

  
33
  if( color.a != 0.0 )
34
    {
35
    fragColor = u_Color;
36
    }
37
  else
38
    {
39
    discard;
40
    }
32
  fragColor  = vec4(u_Color.rgb, sign(color.a)*u_Color.a);
41 33
  }

Also available in: Unified diff