Announcement

Collapse
No announcement yet.

Incredible issue on GLSL

Collapse
This topic is closed.
X
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Incredible issue on GLSL

    Hello

    Im having this "insane" (for me) bug using GLSL. I have this stupid trivial shader that you can see in the picture.


    It works. But if I change the row 16 in something like "return A > 0;" some inexplicable artifacts/problems appears in the resulting image. That's really unbelievable to me, im not even using the PointSide function

    Could someone tell what the heck is going on???

    thanks!!!

  • #2
    Please help

    Comment


    • #3
      Hello NiG !

      For the piece of your code, looks fine, so in order to help you more with this problem could you upload us a sample with the bug so we can check out what is going on?

      Meanwhile you can check out our samples using GLSL here

      Comment


      • #4
        Hello, thanks.

        I've attached the lens source files, and the HLSL version of the shared. It has a number of parameters, but they dont matter now: even the simplest GLSL shader doesn't work (see the acttached picture in my opening post).

        This is really weird. It seems that some unused code in the shader can modify the output/behavior of the shader itself. Really unbelievable. The HLSL version works perfectly.

        Tomorrow I'll look at your examples, but I already saw some examples of your. In fact, I didn't notice any problem. That's really annoying. It's blocking me.

        please help

        thank you!!
        Attached Files

        Comment


        • #5
          Actually, the same thing happens with your sample.

          I've downloaded "DisappearEffect" and it works on Android device. But if I add (without using it) this function:

          bool PointSide(vec2 S, vec2 E, vec2 p)
          {
          float A = -(E.y - S.y);
          float B = E.x - S.x;
          float C = -(A * S.x + B * S.y);
          if(A * p.x + B * p.y + C > 0)
          return true;
          else
          return false;
          }


          to the .frag GLSL file, nothing appears into the screen.

          What is it????????

          Comment


          • #6
            Hello guys,

            I really need help my development is almost stopped because of this

            Comment


            • #7
              Hi NiG,

              I am so sorry for the long delay for the response.

              In your function I've found a syntax error.
              if(A * p.x + B * p.y + C > 0) ------> if(A * p.x + B * p.y + C > 0.0)

              I recommend you to test your shader syntax in any of the following online editor:

              http://www.kickjs.org/example/shader...er_editor.html
              http://shdr.bkcore.com/

              Greetings!

              Comment


              • #8
                hello,

                yeah, actually there were some subtle syntax error. The online compilers were ok.

                thanks

                Comment

                Working...
                X