1D texture in shader

I have some 1D texture and loaded with loader.loadTexture. When I access it in a shader with tex1D, it seems always return 0. Do I need to set up something before it can be used ?

hmm, mostly textures are 2D and its also 2D if you draw on a computer a colored line (like 1px to 100px). but if you really wanna go for this, you should do this by UV set side, that would more lead you into real 1D. just merge all your uvs till you have your liked line. :smiley:

may i ask you, are you going to do a less byte demo, or why are you doing this and if you are pointing onto such a demo, panda would not be perfect for - this the engine is to big, maybe you should write your own engine. oh and normally peoples in the demo scene are using procedural texturing.

but if you wanna do something which really rocks, then take a look on octree voxels :wink:

youtube.com/watch?v=VpEpAFGplnI

Does the 1px already vertical (…x1) ?

A small piece of code showing how it’s not working would be greatly appreciated.

hmm…it is horizontal.

Maybe

panda3d.org/apiref.php?page= … p1dTexture

helps. With a normal loadTexture, Panda3D has no reason to not think that it is a 2D texture.

Right, if you just load a texture with loader.loadTexture, even if it is 32x1 pixels or something, panda will still return a 2-d texture object. The only way to get an actual 1-d texture object is either to call setup1dTexture by hand and load the texture explicitly, or to load the texture from an egg file that has the appropriate syntax to specify a 1-d texture.

Of course, there’s not a lot of reasons to use a 1-d texture, since a 2-d texture can do anything a 1-d texture can do.

David

@ynjh_jo: yes ! :smiley: its 1px to much :wink:

Ok, I use tex2D then. Thank you.