Jump to content

  • Log In with Google      Sign In   
  • Create Account


ViLiO

Member Since 17 Oct 2003
Offline Last Active Mar 04 2012 03:26 PM
-----

Posts I've Made

In Topic: HL2 BSP Lightmap Coordinates

12 September 2010 - 09:46 PM

The reason for the padding was to stop the texels from neighbouring packed lightmaps bleeding into each other. To do this I add a border around each packed lightmap (so a 16x16 lightmap becomes 18x18 when packed) and the padding gets filled with the nearest texel on the source lightmap. The texture coords are then adjusted to only address the 16x16 area inside the packed lightmap.

There is quite an old article on flipcode that explains some of the reasons bleeding occurs http://www.flipcode.com/archives/Light_Mapping_Theory_and_Implementation.shtml

There are a few other ways you could solve your texture seams, padding with a 1 texel border is just the one I favour :)

All the best,
ViLiO

In Topic: HL2 BSP Lightmap Coordinates

12 September 2010 - 08:14 PM

Assuming you are creating a texture for each individual lightmap, this looks like it could be solved by setting the AddressU and AddressV render states to Clamp (or CLAMP_TO_EDGE_EXT in OpenGL).

In my own hl2 bsp renderer I packed lightmaps into a fewer larger textures using a technique similar to http://www.blackpawn.com/texts/lightmaps/default.html and padded each lightmap with a 1 pixel border to avoid seams.

Regards,
ViLiO

In Topic: HL2 BSP Lightmap Coordinates

12 September 2010 - 12:54 PM

My apologies if anything I am about to say is complete nonsense as it has been over 2 years since I last looked at my hl2 bsp source code :)

The only thing I can see that you have omitted, is not subtracting the LightmapTextureMinsInLuxels from the lu/lv before dividing by the corresponding LightmapTextureSizeInLuxels.

So I think your code should read...
float lu = TextureInfo[Faces[faceId].texinfo].lightVecsU.dotProduct(Vertexes[vertexIndice])
+ TextureInfo[Faces[faceId].texinfo].lightOffsetU
- Faces[faceId].LightmapTextureMinsInLuxels[0];

float lv = TextureInfo[Faces[faceId].texinfo].lightVecsV.dotProduct(Vertexes[vertexIndice])
+ TextureInfo[Faces[faceId].texinfo].lightOffsetV
- Faces[faceId].LightmapTextureMinsInLuxels[1];

lu /= (Faces[faceId].LightmapTextureSizeInLuxels[0] + 1);
lv /= (Faces[faceId].LightmapTextureSizeInLuxels[1] + 1);

Regards,
ViLiO

In Topic: Both Programmer and modeler

01 January 2010 - 02:18 PM

Quote:
Original post by dhulli
I mean, I don't want to waste so much time just to make test models.
Can someone give me an example of someone who's both a professional games programmer as well as a professional 3d modeler?
From what I recall, Mark Healey did both on Rag Doll Kung Fu ...among many other things [smile]

Regards,
ViLiO

In Topic: G prefixed API

24 December 2009 - 01:22 AM

This is a bit of a guess as I've never worked with it, but Scaleform seems to be common to all the games you have listed.

Regards,
ViLiO

PARTNERS