-
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?
-
Senior Member
OpenGL Guru
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.
-
Advanced Member
Frequent Contributor
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?
-
Super Moderator
OpenGL Lord
Re: Query linear sampling support(PCF, float tex)
Even better if it reports an error.
-
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)
-
Senior Member
OpenGL Guru
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules