Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Query linear sampling support(PCF, float tex)

  1. #1
    Intern Contributor
    Join Date
    Jan 2007
    Posts
    89

    Query linear sampling support(PCF, float tex)

    Is is possible to detect whether linear sampling is supported for:
    a.) float16/32 textures
    b.) Percentage closer filtering(PCF) for shadow comparisons

    For example, the Ati X800 can sample them only with GL_NEAREST, and will report an error when trying GL_LINEAR. ATI X3850 can sample them correctly with GL_LINEAR.

    Is there a specific extension or texture state to query the capability?

  2. #2
    Senior Member OpenGL Guru
    Join Date
    May 2009
    Posts
    4,948

    Re: Query linear sampling support(PCF, float tex)

    No, there is not. The GL spec requires that these are supported, and it is a driver bug if they are not.

    The best you can do is use the VENDOR string to try to detect which hardware you're running on. The wiki has an article with some tips on this.

  3. #3
    Advanced Member Frequent Contributor arekkusu's Avatar
    Join Date
    Nov 2003
    Posts
    761

    Re: Query linear sampling support(PCF, float tex)

    You can just try it, see it if works, then choose a rendering path.

    I.e. create a 2x1 texture with one black texel and one white texel. Draw a quad covering a 3x1 area. Now read back the middle pixel; was it grey?

  4. #4
    Super Moderator OpenGL Lord
    Join Date
    Dec 2003
    Location
    Grenoble - France
    Posts
    5,580

    Re: Query linear sampling support(PCF, float tex)

    Even better if it reports an error.

  5. #5
    Intern Contributor
    Join Date
    Jan 2007
    Posts
    89

    Re: Query linear sampling support(PCF, float tex)

    Thank you for your answers. So there is no "clean" check.

    The gl error occured when creating a FBO with a shadow comparison texture as target with GL_LINEAR(error=framebuffer incomplete on X800).

    The check i use now: If (maxTextureSize>=8192 or nvidia_only_extension) => use PCF / float hardware filtering.

    (PCF, float tex filtering and maxTextureSize=8192 are requirements of DX10, afaik)

  6. #6
    Senior Member OpenGL Guru
    Join Date
    May 2009
    Posts
    4,948

    Re: Query linear sampling support(PCF, float tex)

    You could just check for GL 3.0+ or NVIDIA extensions. No need to test the texture size.

  7. #7
    Intern Contributor
    Join Date
    Jan 2007
    Posts
    89

    Re: Query linear sampling support(PCF, float tex)

    I'm stuck with the old catalyst 8.8 driver(closed box legacy product), so no GL3.0 for the 3850 yet.
    Otherwise yes, checking GL3.0 would be the best way.

    (I use the 8K texture size to indirectly determine DX10 hardware support. There is no pre-DX10 card which can handle 8K textures i think)

  8. #8
    Senior Member OpenGL Guru
    Join Date
    May 2009
    Posts
    4,948

    Re: Query linear sampling support(PCF, float tex)

    I would strongly suggest not developing on such a machine. Your users are going to have to use up-to-date drivers anyway to avoid crashing. It's best if your development environment mirrors what your users will have.

  9. #9
    Advanced Member Frequent Contributor
    Join Date
    Dec 2007
    Location
    Hungary
    Posts
    985

    Re: Query linear sampling support(PCF, float tex)

    Quote Originally Posted by Nighthawk
    I'm stuck with the old catalyst 8.8 driver(closed box legacy product), so no GL3.0 for the 3850 yet.
    Otherwise yes, checking GL3.0 would be the best way.
    You mean a Radeon HD3850? That's a still supported product and should support GL3.3.
    Disclaimer: This is my personal profile. Whatever I write here is my personal opinion and none of my statements or speculations are anyhow related to my employer and as such should not be treated as accurate or valid and in no case should those be considered to represent the opinions of my employer.
    Technical Blog: http://www.rastergrid.com/blog/

  10. #10
    Senior Member OpenGL Guru
    Join Date
    May 2009
    Posts
    4,948

    Re: Query linear sampling support(PCF, float tex)

    I'm guessing that by "closed box", he means that he can't update the driver. I don't know how that's possible, but there could be some restriction.

Posting Permissions

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