It is currently Mon Dec 18, 2017 7:54 am

All times are UTC - 5 hours




 Page 1 of 1 [ 5 posts ] 
Author Message
 Post subject:
PostPosted: Fri Feb 23, 2007 5:26 pm 
Site Admin

Joined: Sun Feb 11, 2007 8:59 am
Posts: 1105
Location: Ontario Canada
The ability to add textues to items in the scene graph is established.  The previously constructed Texture class is upgraded and a new function is added to the Scene class.
VMK24A/B has been split into two parts so that the download file size is a little bit easier to work with. Because of this, VMK24A will only play up to the beginning of 20min. VMK24B contains the rest of the video.  After you download both parts, you can extract all VMK files (from 24A and 24B) into one directory to allow you to watch the entire VMK in one go.
 One thing that I forgot to show in the VMK is that you will need to call DeleteAllTextures(); from within the Scene:ClearAll() or else you will have a memory leak.


Offline
 Profile  
 
 Post subject: Re: GameDev VMK 24 - Textures in Scene Graph
PostPosted: Wed Feb 28, 2007 7:23 am 
Site Admin

Joined: Sun Feb 11, 2007 8:59 am
Posts: 1105
Location: Ontario Canada
In VMK24C I have added support for different texture quality types as well as mip mapping.


Offline
 Profile  
 
 Post subject: Re: GameDev VMK 24 - Textures in Scene Graph
PostPosted: Thu Mar 01, 2007 7:35 pm 
Site Admin

Joined: Sun Feb 11, 2007 8:59 am
Posts: 1105
Location: Ontario Canada
In VMK24D, support for the alpha channel in the texture files is re-established.  Now you can make doors with windows and chain link fences all out of one textured object with ease.


Offline
 Profile  
 
 Post subject: 2D mipmap eats 1.(3) times more memory then original texture
PostPosted: Sun Nov 16, 2008 10:52 am 

Joined: Wed Aug 06, 2008 7:53 pm
Posts: 182
Location: Russia
--- A simple mipmap memory cost analysis (2D case).
It could be interesting how much memory takes mip-mapping support. To get it we need to sum up the size of main texture and all mipmap-generated sub-textures, e.g. if base texture is 128x128, then sub-textures are 64x64, 32x32, 16x16, 8x8, 4x4, 2x2, 1x1. Since on each step the size is reduced by half (in each dimension) we get geometric progression with b1 = 1 and q = 4. Hence (N+1) = (4^(N+1) – 1) / 3. Comparing the later with original texture size 2^(2*N) = 4^N we got the ratio ~ 4/3. In other words mip-mapped texture costs only 1.(3) of original texture size. Well enough!
Just to feel this in real numbers, let's take a texture with N = 8 or 256x256 = 64K pixels. Mipmap weights (4^9 - 1)/3 = (2^18 - 1)/3 = 262143/3 = 87381 pixels. The ratio is 87381/65536 = ~ 1.3333282470703125 = ~ 1.(3)

For 1D case mipmap costs 2x of original size, but who cares for 1D textures :)



--- This link - Advanced OpenGL Texture Mapping. - to an ancient article (with pictures) on OpenGL texturing might help to better understand some parameters.



_________________
«Computer scientists deal with algorithms that you may call practical in theory but unpractical in practice.» © Timothy Gowers
Offline
 Profile  
 
 Post subject: Mipmap overhead esteemation via decreasing infinite series
PostPosted: Fri Nov 21, 2008 5:50 am 

Joined: Wed Aug 06, 2008 7:53 pm
Posts: 182
Location: Russia
For completeness, another method of mipmap overhead estimation is summing up decreasing infinite series, when the 1st term is 1 = original texture, 2nd is reduced by half in both dim or ¼, then 1/16 and so on:
S(∞) = 1 + ¼ + 1/16 + 1/64 +...
This is also the geometrical progression: b1 = 1, q = ¼. General formulae is S(∞) = b1/(1-q) = 1/(1-1/4) = 4/3.
Thus, the original texture size is 1, mipmap set is 4/3.



_________________
«Computer scientists deal with algorithms that you may call practical in theory but unpractical in practice.» © Timothy Gowers
Offline
 Profile  
 
Display posts from previous:  Sort by  
 Page 1 of 1 [ 5 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Jump to:  

cron