-
Notifications
You must be signed in to change notification settings - Fork 616
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem with cloud-svg: only fg_color is drawn #19
Comments
I do have float textures btw. |
Ubuntu Linux with OPenGL 4.3.0 NVIDIA GT420M |
The result is better if change:
to:
But the aliasing seems incorrect. @rougier Are you sure you are not mixing up fg_color and bg_color somewhere? |
Made lot of change, could you test again ? |
Nope, still the same ... I can probably have a look later. Any ideas on what I can try? |
Yep, uncomment lines 134-138 and comment lines 140-141. Also, for debugging, use this for initialisation: Create veticesn = 1 Optionally, you light want to set v_linewidth to 10 in the shader On Aug 13, 2013, at 1:56 PM, Almar Klein notifications@github.com wrote:
|
Found it! You should not pass data with negative values to a texture. Normal values for samplers are between 0.0 and 1.0. Apparently some implementations allow negative values, but not mine. So I add 0.5 to the data before it is uploaded to OpenGL, and in the shader I do:
|
Cool ! Thanks and weird. Since you're supposed to have float texture, you should be able to get neg value. Do you have a reference on that ? Did you pushed you change, shoudl I close the issue ? On Aug 13, 2013, at 2:56 PM, Almar Klein notifications@github.com wrote:
|
I guess the FLOAT texture says more about precision than about range. The set_data() method does have a clim parameter to set the min and max value that should be mapped to [0..1]. I do not have a reference (cannot find anything in the Gold book at least), but my guess is that the behaviour outside the range [0..1] is undefined, since it does not make sense when talking about colours. I have run into this issue before with visvis. I did not push the change yet ... |
Ok, I checked the texture.py class and I think we're not using float textures From http://compgroups.net/comp.graphics.api.opengl/floating-point-texture-values-clampe/75517 You should specify the bit depth of the internal format. GL_RGBA usually means 8 bit per channel, mapped to [0,1]. GL_RGBA32F_ARB gives you the full range of float values. Have a look at http://www.opengl.org/registry/specs/ARB/texture_float.txt for the details. Having the data in float does not mean we have a float texture but only tells OpenGL how to read the texture. What I don't quite get is why it is working on my machine and others. Anyway, we should have the GL_RGBA32F (if available on GL ES). On Aug 13, 2013, at 6:19 PM, Almar Klein notifications@github.com wrote:
|
On Tue, Aug 13, 2013 at 12:37 PM, Nicolas Rougier
. . . type may be used as a hint to specify how much precision is desired, On my machine, they appear to be stored with 8-bit resolution. I have a Luke |
Of precision it says "The GL converts it to floating point". Or do they mean the client-side does this before it is send to the server-side, where it can be whatever. I always thought texture data was 8 bit fixed point or something. About range it says that values are clamped to [0..1]. The OpenGL 4 docs say that as well btw: http://www.opengl.org/sdk/docs/man/xhtml/glTexImage2D.xml Packing 32 bit floats only works for scalar textures, or we'd have to make the texture 4x wider or something :) I would not make that our default texturing approach. But its good to know the limitations and how these can be overcome in case that's needed. |
I made a fix now --- forgot to mention in the commit message, so here goes: I guess this fixes this issue, right? |
It closed this issue but not the texture float. I'll open a new issue. On Aug 13, 2013, at 9:59 PM, Almar Klein notifications@github.com wrote:
|
Add ability to do subimage and float texture stores
All shapes are grey. cloud.py does work (white disks with a black border)
The text was updated successfully, but these errors were encountered: