Inside3D!
     

Diffuse mapping- baked into lightmap?

 
Post new topic   Reply to topic    Inside3d Forums Forum Index -> General Programming
View previous topic :: View next topic  
Author Message
Downsider



Joined: 16 Sep 2008
Posts: 477

PostPosted: Sun Jun 21, 2009 4:13 am    Post subject: Diffuse mapping- baked into lightmap? Reply with quote

Is this possible? O_o

Would it look satisfactory?
Back to top
View user's profile Send private message
mh



Joined: 12 Jan 2008
Posts: 909

PostPosted: Sun Jun 21, 2009 1:36 pm    Post subject: Reply with quote

Question

Diffuse mapping is just a standard texture, unless I'm mistaken and you mean something else.

In any case, the Quake lightmaps are (1) low res, (2) not mipmapped, and (3) an "atlas" texture (so that each individual surface lightmap is effectively clamped rather than wrapped - http://en.wikipedia.org/wiki/Texture_atlas ), so they would be impractical for any such trickery.
_________________
DirectQ Engine - New release 1.8.666a, 9th August 2010
MHQuake Blog (General)
Direct3D 8 Quake Engines
Back to top
View user's profile Send private message Visit poster's website
MauveBib



Joined: 04 Nov 2004
Posts: 602

PostPosted: Sun Jun 21, 2009 1:47 pm    Post subject: Reply with quote

I presume you mean Deluxmapping?
_________________
Apathy Now!
Back to top
View user's profile Send private message
Downsider



Joined: 16 Sep 2008
Posts: 477

PostPosted: Sun Jun 21, 2009 3:52 pm    Post subject: Reply with quote

MauveBib wrote:
I presume you mean Deluxmapping?


Yeah, yeah that's what I meant >_>

Sorry o_o

Or rather I meant the aspects of deluxemapping, like normal mapping.
Back to top
View user's profile Send private message
mh



Joined: 12 Jan 2008
Posts: 909

PostPosted: Sun Jun 21, 2009 7:17 pm    Post subject: Reply with quote

Ah, that makes more sense. Very Happy

The answer is still probably "no", however. I say "probably" because it's possible, but you shouldn't. Lightmaps are just way too low-resolution. I'm not talking half-resolution or even quarter-resolution, it's something in the order of one-sixteenth resolution! You don't see it in WinQuake because of the way it calculates it's blend from the colormap, and you don't see it in GLQuake because values of gl_texturemode don't affect lightmaps, but for a standard 64 x 64 Quake texture the lightmap equivalent is only 4 x 4.

Increasing the lightmap resolution (by filtering upwards during an upload, for example) is one option, but you would seriously hurt dynamic light update times. The same applies to mipmapping lightmaps, which would be another requirement. To encode a normal map in a lightmap you would need 3 channels, meaning that you've a single channel left over for colour, meaning that you'll lose coloured light. You could take an alternative tactic and bake a height map in, then convert that to the normal map in a pixel shader, but it's gonna be slow and take a lot of instructions.
_________________
DirectQ Engine - New release 1.8.666a, 9th August 2010
MHQuake Blog (General)
Direct3D 8 Quake Engines
Back to top
View user's profile Send private message Visit poster's website
Downsider



Joined: 16 Sep 2008
Posts: 477

PostPosted: Sun Jun 21, 2009 7:25 pm    Post subject: Reply with quote

Ah, okay. Thanks for the explanation. I never actually noticed them being insanely low res, I guess it's just done right so it's pretty ;D
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Inside3d Forums Forum Index -> General Programming All times are GMT
Page 1 of 1

 
Jump to:  
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
You cannot vote in polls in this forum


Powered by phpBB © 2004 phpBB Group