Motherboard Forums


Reply
Thread Tools Display Modes

How to get unnormalized texture coordinates ?

 
 





















Skybuck Flying
Guest
Posts: n/a

 
      09-29-2009, 03:49 PM


Ok I think now I get it where this weirdness is coming from.

Usually coordinate systems are like:

-1 to 1

To give a simple example

-0.49 would still be considered 0.
+0.49 would still be considered 0.

So 0 has a range from -0.49 to 0.49.

And so forth...

So if you wanted to draw pixel 0 in such a coordinate system you would need
to draw the following quad:

(-0.49, -0.49) to (0.49, 0.49).

However since the coordinate system is positive only... it's therefore
shifted to the right by 0.5

So 0 ranges from 0.00 to 0.99
So 1 ranges from 1.00 to 1.99

I am not sure if this information could help anybody...

Maybe ceil would be best...

For now I will let it be !

Bye,
Skybuck.


 
Reply With Quote
 
Skybuck Flying
Guest
Posts: n/a

 
      09-29-2009, 03:57 PM
Actually truncate would probably be best.

In screen space 0 is considered to range from 0 to 0.99

So truncating it is !

Bye,
Skybuck.


 
Reply With Quote
 
Ralf Kaiser
Guest
Posts: n/a

 
      09-29-2009, 09:33 PM
Skybuck Flying schrieb:
>
> Bye,
> Skybuck.
>


PLEASE STOP TALKING TO YOURSELF ON THE NET!!!

Nobody wants to read this! If you need help, please vistit a mental hospital,
they sure can help you with your problems. But newsgroups are definitively the
wrong place.

 
Reply With Quote
 
fungus
Guest
Posts: n/a

 
      09-29-2009, 09:50 PM
On Sep 29, 10:33*pm, Ralf Kaiser <ralf.kai...@emperortools.de> wrote:
>
> PLEASE STOP TALKING TO YOURSELF ON THE NET!!!
>
> Nobody wants to read this! If you need help, please vistit a mental hospital,


You beat me to it. I was going to mention the exact same thing
- posting 22 replies to yourself on Usenet (in a single thread)
is surely a sign of mental problems.



--
<\___/>
/ O O \
\_____/ FTB.

 
Reply With Quote
 
Skybuck Flying
Guest
Posts: n/a

 
      09-30-2009, 01:11 AM
It's a sign of being healthy...

My fingers type well.

My brain works well cause I find solutions.

Waiting for a bunch of slowass turds to answer my questions and solve my
problems would be a sign of mental problems !

HAHA

Bye,
Skybuck =D


 
Reply With Quote
 
hanukas
Guest
Posts: n/a

 
      09-30-2009, 08:24 AM
On Sep 30, 3:11*am, "Skybuck Flying" <BloodySh...@hotmail.com> wrote:
> It's a sign of being healthy...
>
> My fingers type well.
>
> My brain works well cause I find solutions.
>
> Waiting for a bunch of slowass turds to answer my questions and solve my
> problems would be a sign of mental problems !
>
> HAHA
>
> Bye,
> * Skybuck =D


So you admit that you have problems? Understanding what you are doing
will lessen your problems a lot, take a look at OGL specification some
time.
 
Reply With Quote
 
Skybuck Flying
Guest
Posts: n/a

 
      09-30-2009, 08:30 AM
Hello,

Frame Buffer Object has been implemented.

I just did a little testing... and something interesting popped up.

By using these floating point formats suddenly everything is compatible
again:

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

Which is kinda odd... but I have a theory.

Somehow there is a difference between rendering to screen and rendering to
texture.

When the texture is rendered to the screen then the opengl engine or the
driver or the hardware will convert the floating point texture to
colors/rgba's/bytes.

It's during that process that something odd most be happening... somehow the
opengl engine/driver/hardware must be using a different rounding
technique... maybe it's using truncations or ceils I don't know...

Could/would be interesting to find out...

If I now use this than there will be differences between input and output
texture.. which stay the same... no processing is done yet they become
different:

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

^ Kinda odd...

I am welcome to any other explanations and theories !

But I think I already covered it with the "converting to colors theorie..."

I could try switching back to the above one... and try ceiling and
flooring... to see if that makes a difference !

Bye,
Skybuck.


 
Reply With Quote
 
Skybuck Flying
Guest
Posts: n/a

 
      09-30-2009, 08:38 AM
No,

Bye,
Skybuck.


 
Reply With Quote
 
Skybuck Flying
Guest
Posts: n/a

 
      09-30-2009, 08:38 AM
Sharing is caring

Bye,
Skybuck.


 
Reply With Quote
 
Wolfgang Draxinger
Guest
Posts: n/a

 
      09-30-2009, 11:11 AM
Skybuck Flying wrote:

> Sharing is caring


No. In this case it's vandalism, just like bad graffiti.

--
OpenGL tip #42:
How to exactly map texture texels to screen pixels:
<http://preview.tinyurl.com/cgndc8>
 
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 12:53 PM.

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