Another lightmap question
If I have a lightmap on every triangle in my scene, and I have all my vertex/color/coordinate information stored in vertex arrays, Do i have to call glDrawArrays for every single triangle because my lightmaps are all unique? That ruins the fact that glDrawArrays makes things faster, because now its no faster than using glVerted3f. This is making me mad.
Hi,
From what I remember I don''t think you need to call glDrawArrays for every single triangle, you need to call glDrawArrays for an array with information about a lot of triangle vertices. To do lightmapping and if you are using multitexturing then I think you need to use glClientActiveTextureARB ->
http://www.xfree86.org/4.2.0/glClientActiveTextureARB.3.html
Hope this helps.
From what I remember I don''t think you need to call glDrawArrays for every single triangle, you need to call glDrawArrays for an array with information about a lot of triangle vertices. To do lightmapping and if you are using multitexturing then I think you need to use glClientActiveTextureARB ->
http://www.xfree86.org/4.2.0/glClientActiveTextureARB.3.html
Hope this helps.
a gf4 supports textures of 4096*4096
so you should combine as many lightmaps into one big texture thus switching textures should be reduced
so you should combine as many lightmaps into one big texture thus switching textures should be reduced
another speed up is creating such a large texture for all lightmaps of faces which use the same texture in texunit 0
so you can change the lightmap and texunit 0 at once
and after you have done this and there s still room left in your large lightmap
check if there are more faces with different texunit 0 that can be added to your lightmap
and then sort your faces accordingly
so you can change the lightmap and texunit 0 at once
and after you have done this and there s still room left in your large lightmap
check if there are more faces with different texunit 0 that can be added to your lightmap
and then sort your faces accordingly
i wonder whether i should add lightmap support too
the problem is
i have high polygonal scenes
so i can only use luminance maps 4096*4096*1(BYTE)
RGB maps would blow my video memory(128mb though)
what resolution do your lightmaps have?
the problem is
i have high polygonal scenes
so i can only use luminance maps 4096*4096*1(BYTE)
RGB maps would blow my video memory(128mb though)
what resolution do your lightmaps have?
Most of mine are 8x8, which seemed at first to be way too small, but in practice I found gave amazing results. Anything larger seemed to be overkill. My Voodoo 3 supports 256x256 textures, which allows me 2048 individual tringular lightmaps, unless I''m overlooking something.
which method
?
i am using per pixel lightning with vertex normals
i am planing to implement shadowmaps in the near future though
4096*4096 texes take 16 mb memory if you use them as luminance textures
i guess 16*16 should be enough sind 16*16 pixels are quite a lot
apply some antialiasing and you should get smoother borders between lit and unlit pixels
?
i am using per pixel lightning with vertex normals
i am planing to implement shadowmaps in the near future though
4096*4096 texes take 16 mb memory if you use them as luminance textures
i guess 16*16 should be enough sind 16*16 pixels are quite a lot
apply some antialiasing and you should get smoother borders between lit and unlit pixels
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement