PnP TerrainCreator - Forum

The PnP TerrainCreator Forum
It is currently Fri Oct 20, 2017 9:46 pm

All times are UTC




Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: Raytrace lightmapping
PostPosted: Tue Mar 13, 2007 1:15 am 
Offline

Joined: Fri Jun 10, 2005 12:17 am
Posts: 23
That would be a nice feature, for trees for example...


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 13, 2007 10:15 am 
Offline
Programmierdochfix
User avatar

Joined: Tue Apr 27, 2004 12:53 pm
Posts: 891
Location: Braunschweig
The lightmapping of the terrain surface is raytraced. For the next version I'll try to add correct transparency computation, so the textures of leaves for example don't any longer create big tri- or rectangular shadows but shadows in the shape of the leaves.

But I think, you mean lightmaps for the tree and object models? So that shadows from the terrain and other objects can be seen on that objects and trees, right? This has been requested a few times before. It would surely be a nice feature I'd like to add. The only problem with this is, that it is quite difficult to achive this, if you allow arbitrary input model formats.

Lets say you have a .3ds file, which only has/supports one texture layer. So you have one set of texture coordinates for the vertices of this object. OK, I could try to use the same texture coordinates for a second lightmap texture layer. But if the texture coordinates are not unique (if the same pattern on a texture is used multiple times for the object). The resulting lightmap will look quite ugly. So you see, the problem is not the theoretically easy computation of the lightmap but the proper integration into the program and tool chain.

Basically there are just two possibilities of how this could be solved (at least I only see two).

1. Automatically create a new set of unique texture coordinates for every object used in the TC. I'm not sure if this can be solved easily or if there exist suitable and documented algorithms to achive this. Furthermore, these texture coordinates have to be exported somehow, which is not possible for every model file format.

2. Let the user specify which texture coordinate set should be used for the lightmap. So the user can create the lighmap "template" in 3ds or blender and the TC fills it. If this is specified not in the primary but in a secondary texture coordinate set, many mesh file formats will not be supported for this feature (3ds,x,obj,...).

One final point. In general, the lightmap is unique for every placement/instance of a model on the terrain. So if you have 500 trees of the same kind on your terrain, 500 different lightmaps will be created. I'm not sure if this would be practical.

You see, there are a lot of open issues for such a feature, which sounds very simple. But I'd love to hear any ideas which might be useful for the developing of this.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 13, 2007 11:29 pm 
Offline

Joined: Fri Jun 10, 2005 12:17 am
Posts: 23
I was thinking of transparency in the leaves texture (or any other kind of object) so that the shadow of ground would show up the leaves.

As for creating shadows on objects themself, I think this is more up to the engine being used than PnP. as you said, having 500 different textures for 500 trees, is a bit insane! ;)


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 14, 2007 12:19 am 
Offline
Programmierdochfix
User avatar

Joined: Tue Apr 27, 2004 12:53 pm
Posts: 891
Location: Braunschweig
Great, so I didn't had to write that much :D


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


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 post attachments in this forum

Search for:
Jump to: