Missing 1D texture support for shaders and loader

Bug #983056 reported by paniq
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Panda3D
Invalid
Wishlist
Unassigned

Bug Description

This is more a feature request rather than a bug report, but not being able to use 1D textures as shader input (e.g. for gamma / colormaps / transfer functions) is performance related.

I'd like to be able to pass 1D textures to Shader.setShaderInput(); likewise, "uniform sampler1D k_*" declarations in Cg shaders should be recognized as such. Currently, I have to resort to 2D textures, which needlessly requires bilinear filtering instead of straight linear filtering on the GPU.

Furthermore, I'd be thankful for a new augmentation to the loader, named "loader.load1DTexture", which works analogous to the already existing loader.load3DTexture() and loader.loadTexture(), and supports images with sizes of Nx1. This is functionality that can currently be hand-implemented using PNMImage and/or Texture.setup1DTexture, but having a straight interface would be nice.

Revision history for this message
paniq (paniq) wrote :

Ok, this is not so important to me anymore, as I went full monty for my particular needs and used a 3D texture right away. So feel free to prioritize this as low as you want.

rdb (rdb)
Changed in panda3d:
importance: Undecided → Wishlist
Revision history for this message
rdb (rdb) wrote :

I'm having no luck reproducing this. Passing 1D textures to Cg shaders works just fine for me, both via setTexture and via setShaderInput. Tried with GLSL as well for good measure, that works too.

With regards to loading textures, Nx1 textures are automatically loaded as 1D textures as long as the TF_allow_1d flag is set:

    options = LoaderOptions()
    options.setTextureFlags(LoaderOptions.TF_allow_1d)
    gradient = loader.loadTexture("gradientTexture.jpg", loaderOptions=options)

Changed in panda3d:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.