cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

dan_w
Journeyman III

texture2DGrad() support in glsl?

I've been googling for two days looking for info on using texture2DGrad() in glsl, and all I've found so far is mentions in forums that it is not yet supported; but the posts are a year old or more. Has this changed by now, I hope?

I'd also appreciate if someone could pass me links to code examples using anisotropy. I'm thinking of using anisotropy in 4 ways (not sure if all are possible):

1) Standard way, for anisotropic texture blurring to avoid view angle artifacts

And anisotropic blurring of the environment cube-map for...

2) Material anisotropy, such as standard brush metal finish on stainless sheets.

3) Environment reflections on anisotropically curved surfaces, based on reflective surface curvature (change of normal in screen-space).

4) For ambient light extraction from the environment in the cases of stretched/flattened openings in the ambient occlusion space, which are quite common.

 

But I've never used anisotropy before, in glsl; I'm not even sure if texture2DGrad() is the way to do it. And would there be such thing as a textureCubeGrad()? And what about LOD? Would Grad variants imply LOD control (like for shininess modulation)?

TIA

0 Likes
4 Replies
dan_w
Journeyman III

Bump

0 Likes

Would it be possible for someone to write at least something?

Perhaps I'm asking a dumb question. Perhaps I'm in the wrong forum.

But if all you do is "punish" me with silent treatment, how will I ever know better?

 

I need to know how to use and control anisotropy in a glsl shader. There must be a way? But I spent days googling around and couldn't find any info on it at all, except passing mentions of a texture2DGrad() function that apparently doesn't exist in glsl, so I figured there may be vendor extension for anisotropy?

Please help.

 

 

0 Likes

Perhaps what you are looking for is textureGrad()?  It is supported in glsl 1.40 (OpenGL 3.1), see page 93 from the spec:

http://www.opengl.org/registry/doc/GLSLangSpec.Full.1.40.05.pdf

From the spec, it seems to support 1D, 2D, 3D and cubemap texture.

You might also want to look at dFdx and dfDy functions for getting the derivatives (see page 97).

 

0 Likes

Thank you very kindly. It seems I was looking at the wrong version of the spec, all along

0 Likes