Menu

#252 Reflect shader broken

Verified
nobody
2011-06-05
2011-01-11
Anonymous
No

Originally created by: gijsrooy
Originally owned by: gijsrooy

What steps will reproduce the problem?
1. Launch an aircraft that makes use of Effects/reflect. Like the b29.
2. Enable material shaders.

What is the expected output? What do you see instead?
The aircraft should have a shiny fuselage, but all I see is the normal plain-old texture. Error1 is shown in the console.

When I edit Shaders/reflect.frag and reflect.vert by moving lines "varying vec3 normal, lightDir, halfVector;" and "varying vec3 lightDir, halfVector;" all the way up, Error2 is shown in the console. So apparently, the 9th and 10th variable (?) in the shader files are causing the problem. Independant of the variables being the 9th and 10th.

What version (or GIT date / Hudson build number)?
Today's Git and Hudson build, but it's been like this for a couple of months.

What operating system and graphics card?
Windows Vista, NVIDIA Geforce 7300 driver 179.48 (latest), Opengl 2.1.2

2 Attachments

Related

Tickets: #194
Tickets: #274

Discussion

  • Anonymous

    Anonymous - 2011-01-11

    Originally posted by: bre... (code.google.com)@gmail.com

    (No comment was entered for this change.)

    Cc: frbouvi timoore33

     
  • Anonymous

    Anonymous - 2011-01-11

    Originally posted by: vivian.m...@lineone.net

    I'm not seeing any problem using the B29 on Win XP and nVidia GTX285. Can someone else confirm this problem?

     
  • Anonymous

    Anonymous - 2011-01-12

    Originally posted by: gijsrooy

    In my FG binary there is a osgPlugins-2.9.9 directory. If that means I have 2.9.9; it shouldn't be an OSG problem (I think). Also, Googleing for the errors it seems to be more of an OpenGL problem...

    Vivian, what OpenGL/OSG versions do you have?

     
  • Anonymous

    Anonymous - 2011-01-24

    Originally posted by: lauri.pe... (code.google.com)@gmail.com

    To me this looks like your graphics card/driver is running out of varyings. You should check GL_MAX_VARYING_FLOATS to get the amount and then compare that against how many varyings are used in the shader. If I calculated them correctly, the shader uses 33 varying floats.

    My geforce 6600 reports GL_MAX_VARYING_FLOATS: 32 so might be that the shader wont run correctly on my computer either. I cannot test, since I broke my fg install...

    The shaders in fg are getting very complex, designers soon should think about different way to do things since we're running out of varyings...

    To get the float count, one should run
    glutInit(&argc, argv);
    int max;
    glGetIntegerv(GL_MAX_VARYING_FLOATS, &max);
    std::cout << "GL_MAX_VARYING_FLOATS: " << max << std::endl;

    It would be nice if there was a simple way to fetch these values from either via flightgear or some other tool...

     
  • Anonymous

    Anonymous - 2011-01-24

    Originally posted by: aeitsch...@yahoo.de

    Would it be possible to recreate those affected shaders with less varyings?

     
  • Anonymous

    Anonymous - 2011-02-11

    Originally posted by: lauri.pe... (code.google.com)@gmail.com

    Yeah, and I just did that. I managed to remove something like 6 unused varyings, and now the shaders (reflect, reflect-bump-spec and bumpspec) work for me.

    Attached is a patch to modify all those, please see if they break anything.

    I tried b29 (reflect), ju52 (reflect-bump-spec) and ask13 (bumpspec) which seemed to look just fine.

    Labels: fixable

     
  • Anonymous

    Anonymous - 2011-02-11

    Originally posted by: gijsrooy

    Works for me! Should go into the 2.2 branch I'd say. Thanks a lot!

    Status: Verified

     
  • Anonymous

    Anonymous - 2011-02-11

    Originally posted by: bre... (code.google.com)@gmail.com

    Uhm - closed & verified? I don't see any FG commit yet... Was this already pushed?
    Also vote to patch the 2.2 branch. Can anyone confirm it's safe & risk-free? ;)

    Status: Testing

     
  • Anonymous

    Anonymous - 2011-02-12

    Originally posted by: frbo... (code.google.com)@gmail.com

    Your patch doesn't apply here :

    $ patch -p1 < fgfs-reflect.patch
    patching file `Shaders/bumpspec.frag'
    Hunk #2 FAILED at 29.
    Hunk #3 FAILED at 37.
    2 out of 3 hunks FAILED -- saving rejects to Shaders/bumpspec.frag.rej
    patching file `Shaders/bumpspec.vert'
    Hunk #1 FAILED at 2.
    1 out of 1 hunk FAILED -- saving rejects to Shaders/bumpspec.vert.rej
    patching file `Shaders/reflect-bump-spec.frag'
    patching file `Shaders/reflect-bump-spec.vert'
    Hunk #2 FAILED at 21.
    1 out of 4 hunks FAILED -- saving rejects to Shaders/reflect-bump-spec.vert.rej
    patching file `Shaders/reflect.frag'
    patching file `Shaders/reflect.vert'

    Do you have a tar file with the 6 complete files ?
    Thanks

     
  • Anonymous

    Anonymous - 2011-02-12

    Originally posted by: lauri.pe... (code.google.com)@gmail.com

    Here is a .tar.gz with the 6 files. Unpack them in Shaders/ .

    These are from the GIT version, so I hope the effect files are not changed. If the shaders wont work, I can upload those too.

    - Zan

     
  • Anonymous

    Anonymous - 2011-02-16

    Originally posted by: frbo... (code.google.com)@gmail.com

    The patch has been pushed to master and releases/2.2.0

     
  • Anonymous

    Anonymous - 2011-02-17

    Originally posted by: gijsrooy

    Really fixed now ;)

    Status: Verified

     
  • Anonymous

    Anonymous - 2011-06-05

    Originally posted by: bre... (code.google.com)@gmail.com

    (No comment was entered for this change.)

    Status: Temp

     
  • Anonymous

    Anonymous - 2011-06-05

    Originally posted by: bre... (code.google.com)@gmail.com

    (No comment was entered for this change.)

    Status: Verified

     

Log in to post a comment.

MongoDB Logo MongoDB