Motherboard Forums


Reply
Thread Tools Display Modes

How to get unnormalized texture coordinates ?

 
 





















Skybuck Flying
Guest
Posts: n/a

 
      09-29-2009, 10:01 AM


Hello,

My code tries to upload the texture to the gpu:

glTexImage2D( GL_TEXTURE_RECTANGLE_ARB, 0, GL_RGBA32F_ARB, Width, Height, 0,
GL_RGBA, GL_FLOAT, mTexture );

But it fails with "invalid operation" code 1282 I believe it was.

mTexture is an array of 4 floats so that's ok. width and height: 500x400.

Other code/gpgpu example does seem to work with this... I am not sure why ?

Maybe GL_TEXTURE_RECTANGLE_ARB is only valid for "render to texture" and not
"render to screen" ?

Me <- Confused.

Bye,
Skybuck.




 
Reply With Quote
 
Skybuck Flying
Guest
Posts: n/a

 
      09-29-2009, 10:05 AM
Ok,

I think I figured it out...

It seems to be one or multiple of the texture parameters which are not valid
for this kind of texture....

I disabled all the parameters to use the default parameters to see if that
would help and it did help !

Now the shader seems to run ! and now I can go modify it to see if it
finally uses unnormalized texture coordinates !

Here are the parameters which are suspicious, don't know which ones yet:

// disabled:
(*
// after a texture is bound it's settings can be set.
glTexParameteri( mTextureTarget[vTextureIndex], GL_TEXTURE_MIN_FILTER,
GL_NEAREST );
glTexParameteri( mTextureTarget[vTextureIndex], GL_TEXTURE_MAG_FILTER,
GL_NEAREST );

// use only original texture no mipmap levels
glTexParameteri( mTextureTarget[vTextureIndex], GL_TEXTURE_MIN_LOD, 0 );
glTexParameteri( mTextureTarget[vTextureIndex], GL_TEXTURE_MAX_LOD, 0 );

// sets the mipmap levels to just one/original zero
glTexParameteri( mTextureTarget[vTextureIndex], GL_TEXTURE_BASE_LEVEL,
0 );
glTexParameteri( mTextureTarget[vTextureIndex], GL_TEXTURE_MAX_LEVEL, 0 );

// don't use border texels.
// produces strange vertical line to the left
glTexParameteri( mTextureTarget[vTextureIndex], GL_TEXTURE_WRAP_S,
GL_CLAMP_TO_EDGE );
glTexParameteri( mTextureTarget[vTextureIndex], GL_TEXTURE_WRAP_T,
GL_CLAMP_TO_EDGE );

// produces strange vertical line left and horizontal line bottom
// glTexParameteri( mTextureTarget[vTextureIndex], GL_TEXTURE_WRAP_S,
GL_CLAMP_TO_BORDER );
// glTexParameteri( mTextureTarget[vTextureIndex], GL_TEXTURE_WRAP_T,
GL_CLAMP_TO_BORDER );

// produces same strange vertical line as clamp to edge
// glTexParameteri( mTextureTarget[vTextureIndex], GL_TEXTURE_WRAP_S,
GL_CLAMP );
// glTexParameteri( mTextureTarget[vTextureIndex], GL_TEXTURE_WRAP_T,
GL_CLAMP );

// produces strange bottom horizontal line...
// glTexParameteri( mTextureTarget[vTextureIndex], GL_TEXTURE_WRAP_S,
GL_REPEAT );
// glTexParameteri( mTextureTarget[vTextureIndex], GL_TEXTURE_WRAP_T,
GL_REPEAT );



// turn mipmapping off just in case.
glTexParameteri( mTextureTarget[vTextureIndex], GL_GENERATE_MIPMAP,
GL_FALSE);
*)

Bye,
Skybuck =D


 
Reply With Quote
 
Skybuck Flying
Guest
Posts: n/a

 
      09-29-2009, 10:15 AM
Ok these parameters seem to cause the error, which is pretty stupid, since I
am trying to turn them off anyway out of "safety reasons" !:

// use only original texture no mipmap levels
// glTexParameteri( mTextureTarget[vTextureIndex], GL_TEXTURE_MIN_LOD, 0 );
// causes problem with GL_TEXTURE_RECTANGLE_ARB
// glTexParameteri( mTextureTarget[vTextureIndex], GL_TEXTURE_MAX_LOD, 0 );
// causes problem with GL_TEXTURE_RECTANGLE_ARB

// sets the mipmap levels to just one/original zero
// glTexParameteri( mTextureTarget[vTextureIndex], GL_TEXTURE_BASE_LEVEL,
0 ); // causes problem with GL_TEXTURE_RECTANGLE_ARB
// glTexParameteri( mTextureTarget[vTextureIndex], GL_TEXTURE_MAX_LEVEL,
0 ); // causes problem with GL_TEXTURE_RECTANGLE_ARB

// turn mipmapping off just in case.
// glTexParameteri( mTextureTarget[vTextureIndex], GL_GENERATE_MIPMAP,
GL_FALSE); // causes problem with GL_TEXTURE_RECTANGLE_ARB

Bunch of dumbasses !

Fix your code you driver-dumbasses !

Bye,
Skybuck =D



 
Reply With Quote
 
Skybuck Flying
Guest
Posts: n/a

 
      09-29-2009, 10:16 AM
I forgot to mention one thing though...

Now my shader not working anymore... all I see is the blue which is set in
the shader itself...

The shading/texture is invisible... I already removed the divisions....

Wacky ?!

Bye,
Skybuck.


 
Reply With Quote
 
Skybuck Flying
Guest
Posts: n/a

 
      09-29-2009, 10:31 AM
My conclusion for now, these settings don't work for "to screen", not sure
about "to render texture"

mTextureTarget[vTextureIndex] := GL_TEXTURE_RECTANGLE_ARB;
mTextureInternalFormat[vTextureIndex] := GL_RGBA32F_ARB;
mTexturePixelFormat[vTextureIndex] := GL_RGBA;
mTexturePixelType[vTextureIndex] := GL_FLOAT;

Now I go try some other settings...

Bye,
Skybuck.


 
Reply With Quote
 
Skybuck Flying
Guest
Posts: n/a

 
      09-29-2009, 10:51 AM

"Skybuck Flying" <> wrote in message
news:1f16d$4ac1d404$d53372a9$ b.home.nl...
> My conclusion for now, these settings don't work for "to screen", not sure
> about "to render texture"
>
> mTextureTarget[vTextureIndex] := GL_TEXTURE_RECTANGLE_ARB;
> mTextureInternalFormat[vTextureIndex] := GL_RGBA32F_ARB;
> mTexturePixelFormat[vTextureIndex] := GL_RGBA;
> mTexturePixelType[vTextureIndex] := GL_FLOAT;


^ I gave these settings some more tries... can't get it working... kinda
sux...

Having to normalize the coordinates myself would suck big time ?! Me
thinks..

Bye,
Skybuck.


 
Reply With Quote
 
Skybuck Flying
Guest
Posts: n/a

 
      09-29-2009, 10:56 AM
Hmm strange...

I decided to do one last test and then I would have given up...

However GL_TEXTURE_2D doesn't work anymore either ?!?

I think it might be because setting one of the parameters might turn out to
be crucial ?

Bye,
Skybuck.


 
Reply With Quote
 
Skybuck Flying
Guest
Posts: n/a

 
      09-29-2009, 11:05 AM
Ok this line was commented:

cgGLSetTextureParameter(mCGTexture, mTextureID[0] );

I tried the rectangle thing one more time... it really doesn't work for the
screen which totally sux...

Unless it maybe works for render to texture and then back to screen or so...

But why can't it do that in one time ?

Kinda weird.

For now I declare the rectangle thing DEAD.

^ ****ing piece of ****.

I wonder if there are any more "texture targets"

So far I only seen TEXTURE_2D and the rectangle ****.

Bye,
Skybuck.


 
Reply With Quote
 
Skybuck Flying
Guest
Posts: n/a

 
      09-29-2009, 11:06 AM
Another explanation why rectangle **** might not be working is because
"glew" isn't used ?

But what do I know Me cluessless about all of that stuffffff.

Bye,
Skybuck.


 
Reply With Quote
 
Skybuck Flying
Guest
Posts: n/a

 
      09-29-2009, 11:36 AM
I tried one last thing:

mTextureTarget[vTextureIndex] := GL_TEXTURE_RECTANGLE_ARB;
mTextureInternalFormat[vTextureIndex] := GL_RGBA;
mTexturePixelFormat[vTextureIndex] := GL_RGBA;
mTexturePixelType[vTextureIndex] := GL_FLOAT;

^ Also not working (

Oh well... been trying to find any other texture targets... so far nada.

I guess I will have to be using My****ingValue/My****ingMaximum

All the ****ing time ?!

Bye,
Skybuck.


 
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
iDVD quits after several hours dcm@s2.sonnet.com Apple 3 08-09-2004 09:23 PM


All times are GMT. The time now is 09:30 AM.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43