Results 1 to 5 of 5

Thread: Shader problem - calculation problem with shader validator?

  1. #1
    Junior Member
    Join Date
    Dec 2009
    Posts
    15

    Shader problem - calculation problem with shader validator?

    Hello again,

    next problem. Firefox 4.0 Beta 2 (Laptop Intel IGP and PC GTX 260)

    I often took a value from a texture in the shader. I calculated something with it, all is fine. I switched the Shader validator on and fixed all signaled errors.

    But now I get black Output. For example.

    vec4(texture2D(TexSampler,texcoord).xyz,1.0) This make a nice colorfull Output. But I want only 30%

    vec4(texture2D(TexSampler,texcoord).xyz,1.0)*0.3
    vec4(texture2D(TexSampler,texcoord).xyz * vec(0.3) ,1.0)
    produced both a black object. (Shader validator off = 30% output like i want)

    vec4(texture2D(TexSampler,texcoord).xyz,1.0)*3.0/10.0 produced the 30% output now. But this is not efficient. I found no hint in the updated WebGL Spec what is wrong with *0.3 ?

    Or is it the wrong forum? Should I talk to vladimir directly? (how?)

    greets titan

  2. #2
    Junior Member
    Join Date
    Dec 2009
    Posts
    15

    Re: Shader problem - calculation problem with shader validat

    Firefox 4.0 Beta 3 same problem. validator on = calculations with numbers < 1.0 = 0.0

    Did somebody tried ? Or is all correct?

    greets titan

  3. #3
    Junior Member
    Join Date
    Dec 2009
    Posts
    15

    Re: Shader problem - calculation problem with shader validat

    no Editbutton?

    Using the build in function MIX to mix the texturcolor and black like 0.3 to 0.7 failed too.
    It is full black. I changed it to 0.7 (texturcolor) so there is a 100% texturcolor.



    cya titan

  4. #4
    Junior Member
    Join Date
    Sep 2010
    Posts
    7

    Re: Shader problem - calculation problem with shader validat

    The issue is most likely you're using non power of 2 textures and you have filtering on that requires mips. This is not allowed in OpenGL ES 2.0 and WebGL is supposed to be spec compliant with OpenGL ES 2.0.

    Firefox was not enforcing that requirement until 4.0b2. Now it is so if you are using an NPOT texture and you don't turn off mips you'll get black.

    You can either do

    gl.texParameteri(gl.TEXTURE_2D, gl.GL_TEXTURE_MIN_FILTER, gl.LINEAR); // or gl.NEAREST

    or you can make your texture a power of 2 texture. For example 256x128

  5. #5
    Junior Member
    Join Date
    Dec 2009
    Posts
    15

    Re: Shader problem - calculation problem with shader validat

    right.

    And the textur load function had to be the correct. I used a old Style one. I could not suggest that the SHADER validator needed the new version. There was a change. This was important too

    greets titan

Similar Threads

  1. Shader support
    By sfx1999 in forum Suggestions for future OpenGL ES releases
    Replies: 1
    Last Post: 12-02-2004, 07:50 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •