Archived

This topic is now archived and is closed to further replies.

Stylez99

help render to texture 1024x1024

Recommended Posts

Hi, i use the source code from nehes opengl tutorials 36. the textures looks good with 512x512 but when i use 1024x1024 the texure is not complete...it have a big black border around it... Hope anybody can help me. Bye Stylez PS: Sorry for my bad english

Share this post


Link to post
Share on other sites
quote:
Original post by Dredge-Master
some do, but alot (probably most) don''t

My NV25 is able to load 4096x4096 RGB and I also think my NV15 is.
Maybe I should recall that one of the failures of the voodoo3 was the support for textures no larger that 512x512 (or maybe it was 256x256?) and this was caused too little.

Share this post


Link to post
Share on other sites
Almost all video cards do support textures up to 4096x4096, but it''s recommended not to go over 2048x2048.

If your card can''t handle it, you will know by calling glTexImage2D with GL_PROXY_TEXTURE_2D : take a look at the Red Book I think the examples are pretty clear about that.

Share this post


Link to post
Share on other sites
My TnT2 support 2048*2048 textur size. Almost graphic card todays support 4096*4096 texture size.
So, the problem isn''t the texture size....but I thinck it is the frame buffer size. If you are using a resolution of 1024*768 then when you render to texture of size 1024*1024, the X is complecte without any black hole, but in the bottom of your texture it will appear a black border. If you are using a resolution of 800*600 or 640*480 then it will appear black holes in x and y at the same time. If you are using a resolution of 1280*1024 you shouldn''t an problem at all!

Share this post


Link to post
Share on other sites
quote:
Original post by Krohm
quote:
Original post by Dredge-Master
some do, but alot (probably most) don''t

My NV25 is able to load 4096x4096 RGB and I also think my NV15 is.
Maybe I should recall that one of the failures of the voodoo3 was the support for textures no larger that 512x512 (or maybe it was 256x256?) and this was caused too little.




two cards in mine, one supports 2048x2048 and the other supports 1024x1024.

Doesn''t mean that everyone''s card will support it though. Anyone using pre TNT2 and GeForce2 cards (I think it was this time that ibm-pc cards got to 1024x1024) won''t have much behind them.


... Get an ultrasparc with a 512mb video card you may be stuck in sunos and solaris, but with that for a video card (and accelerator) who cares

Share this post


Link to post
Share on other sites
Hi Filami,
i cant use a resolution about 1280*1024. My resolution is 640x480 and when i render a scene to a textur with 512x512size its looks not god ... my idea was when i render the textur with the size 1024x1024 that the scene looks good.

bye
Stylez

Share this post


Link to post
Share on other sites
Well if you use 1024x768 resolution and you are rendering to the screen and then copying to a texture then it''s normal that the texture will look like crap because the framebuffer is only 1024x768 and the texture is 1024x1024. try using 1280x1024.

[ My Site ]

Member of "Un-Ban nes8bit" association (UNA) (to join put this in your sig) (Welcome back to JesperT)
Founding member of "Dave Astle is an ALIEN god" association (DAIAAGA) (proof here)(to join put this in your sig and praise Dave daily)
/*ilici*/

Share this post


Link to post
Share on other sites
in fact, you are not rendering to the texture! Thats is only possible to do with PBuffers I thinck. What that tecnics does is to render to the frame buffers as normal and copy it to the texture. If one of your sides of the texture are biggers than the frame buffers, off corse part of the texture will be out of frame buffer and still be black! If you are using a 640*480 resolution, you cannot use a texture size if 512*512...One trick is to use the biggest resolution possible under the frame buffer resolution. In this case, 640*480 is better to use the resolution 512*256 for textures. For the 800*600 you can use the 512*512...and so on. If you wnat to do it mathematiclaly so that user can chose is resolution and have a texture of the right size, do this:
This is equal for width and height, so, size is the frame buffer size (that can be bouth width and height)

float screenExp = log(size)/log(2); //this will give you the exponent of texture. Notice that it isn''t an integer but a real number. Notice to that log is devided by the log of 2. Mathematiclaly this means that you are logging size by the base of 2.

float texExp = floor(screenExp); //this will calculate the biggest integer under your real number. The result is a integer number that is the exponent of texture.

int texSize = (int)pow(2,texExp); //now you calculate the texture size just powering 2 by the texExp that is the exponent.

If you don''t undestand a part or if you discover a bug, just post it, ok?

Share this post


Link to post
Share on other sites