I try and use a sampler3D in a GLSL 1.4 and I get a warning:
global function texture3D is deprecated after version 120
I’m wondering; why, and what exactly can I use after version 120 to replace it? I couldn’t find any mention of it being deprecated in my Google searches, can anyone please elaborate? I was going to use it for volume rendering but its absence complicates things.
NOTE:
If I roll back to #130, it renders but I still get the warning. Driver bug? nVidia 9500GT with latest drivers.
A secondary question along the same lines; is it possible to get both a linear interpolated and nearest neighbor sample of the same texture in the same fragment? (i.e. without duplicating my 64mb sample)
Also, a tertiary question. How is a vec3 comparison handled? Do all the elements of a have to be greater than b for a > b to return true or just at least one?
Since texture filtering is a part of the texture state I’m sure you would have to do the filtering yourself.
I’m pretty sure that GLSL doesn’t define any > operator for vec3, so if the NVIDIA implementation does than god knows what that does. Presumably the same thing as in Cg.
A secondary question along the same lines; is it possible to get both a linear interpolated and nearest neighbor sample of the same texture in the same fragment? (i.e. without duplicating my 64mb sample)
ARB_sampler_objects allows you to sample the same texture with different filters.
If you want component wise comparison, you can use greaterThan(vec, vec) or lessThan(vec, vec) (et al.) which return a bvec, and any(bvec) or all(bvec) on that.
The idea here is that this should produce the 0…1 screen space coordinates for use with a texture overlay. I’m taking the vertex position, transforming it, extracting the X/Y position, compressing it from -1 to 1 into 0 to 1 and then multiplying it by a uniform that defines how much of the texture is empty space (texture is PO2, screens rarely are)
It doesn’t work as expected; the end result is still being influenced by the shape, causing distortions, and also off scale. Any quick suggestions before I go?