PDA

View Full Version : poor quality with 1D textures



mithun_daa
12-01-2003, 12:18 PM
i dont know if 1D textures are rendered this way, or if im going wrong somewhere. I initially developed a program that generates a surface from a height map. I used the usual glcolor* statement to color each vertex, and it looks awesome. now im trying to do the same thing using a 1D texture. the problem is that the quality is pretty sad. i can see the colors changing from one level to another (its not smooth). i have a couple of snapshots at the following url. can anyone tell me where i am goin wrong, or if what i m gettin is what 1D textures can do best.
www.geocities.com/mithunp4u/ (http://www.geocities.com/mithunp4u/)

thank u.

Mazy
12-01-2003, 12:22 PM
it doenst look like you enabled bilinear filter on the texture..

mithun_daa
12-01-2003, 12:29 PM
Originally posted by Mazy:
it doenst look like you enabled bilinear filter on the texture..
how do i enable it?

mithun_daa
12-01-2003, 12:39 PM
Originally posted by mithun_daa:

Originally posted by Mazy:
it doenst look like you enabled bilinear filter on the texture..
how do i enable it?

im sorry, but i have enable the mag & min filters, they are set to be linear filters.

ScottManDeath
12-01-2003, 05:00 PM
the filters are per texture object and per texture target, so use GL_TEXTURE_1D in the glTexParameter* calls

Ysaneya
12-01-2003, 11:35 PM
Make sure your texture internal format is 32 bits.

Y.

zeckensack
12-02-2003, 12:26 AM
So you weren't satisfied with old thread on the same topic (http://www.opengl.org/discussion_boards/ubb/Forum3/HTML/010955.html) ?

Anyway, wild guess: your texgen params still aren't right. I could hand you the right ones if you actually answered the question I posed in the other thred.

Oh well ... there goes the 'advanced' forum ...

mithun_daa
12-02-2003, 05:50 AM
Originally posted by zeckensack:
So you weren't satisfied with old thread on the same topic (http://www.opengl.org/discussion_boards/ubb/Forum3/HTML/010955.html) ?

Anyway, wild guess: your texgen params still aren't right. I could hand you the right ones if you actually answered the question I posed in the other thred.

Oh well ... there goes the 'advanced' forum ...

k zeckensack, the reason i posted again is cause i fixed the problem with ur suggestion, but the quality was poor. so i updated the website and posted again to show the new changes and my new problem.

k herez how im setting my filters

currentCoeff(0) = 0#
currentCoeff(1) = 0#
currentCoeff(2) = -1 / (dblZMax - dblZMin + 95)
currentCoeff(3) = 0#
glGenTextures 1, texName
glBindTexture glTexture1D, texName
glTexParameteri glTexture1D, tpnTextureWrapS, GL_REPEAT
glTexParameteri glTexture1D, tpnTextureMagFilter, GL_LINEAR
glTexParameteri glTexture1D, tpnTextureMinFilter, GL_LINEAR
glTexImage1D glTexture1D, 0, GL_RGBA, ColorScaleWidth, 0, GL_RGBA, GL_UNSIGNED_BYTE, bytColorScale(0)
glTexImage1D glTexture1D, 0, 4, ColorScaleWidth, 0, GL_RGBA, GL_UNSIGNED_BYTE, bytColorScale(0)
glTexEnvf tetTextureEnv, tenTextureEnvMode, tepModulate
glTexGeni GL_S, GL_TEXTURE_GEN_MODE, tgmObjectLinear
glTexGenfv GL_S, tgObjectPlane, currentCoeff(0)

no the right textures are being generated, but as u can c on the link posted above, there are bands of colors which doesnt look very realistic.
could it be happening cause im using byte as the format. using a float would (i think) cause some improvements.

Mazy
12-02-2003, 06:10 AM
glTexImage1D glTexture1D, 0, GL_RGBA8, ColorScaleWidth, 0, GL_RGBA, GL_UNSIGNED_BYTE, bytColorScale(0)

just to make sure..

mithun_daa
12-02-2003, 06:18 AM
Originally posted by Mazy:
glTexImage1D glTexture1D, 0, GL_RGBA8, ColorScaleWidth, 0, GL_RGBA, GL_UNSIGNED_BYTE, bytColorScale(0)

just to make sure..

that did itttttttttttttttt!!!! thanx a looooot mazy

Ysaneya
12-02-2003, 06:22 AM
That's incredible. What did i suggest ?

Why are you posting if you're not even reading other people's suggestions ?

Y.