Go Back   AC3D Forums > Resources > AC3D Plugins and Other Resources
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 27th January 2010, 04:08 PM   #11
virtualalias
Member
Expert member
 
virtualalias's Avatar
 
Join Date: Jun 2008
Posts: 67
Talking Re: PLUGIN: Render to Texture: Light Maps, Normal Maps, AO

If this works, I may have to ask you to marry me.
__________________
----------------------------------------------------------
AC3D Dock Icon
virtualalias is offline   Reply With Quote
Old 19th May 2010, 12:56 PM   #12
lordfly
Junior Member
Junior member
 
Join Date: May 2010
Posts: 8
Default Re: PLUGIN: Render to Texture: Light Maps, Normal Maps, AO

I'm a new AC3d user, hoping to use AC3d for the upcoming mesh features for Second Life (yes, they're getting honest to god meshes now, instead of sculpties).

Anyways, when using this renderer, perhaps I'm using it wrong, but the output is either one of three things:

1) A basic texture output (no lighting, shading, or UV mapping)
2) pure black
3) pure white

On one shape I was testing on, I did get an interesting half-texture/half black thing going, but that's about it.

Lights seem to have no effect on any of it. :/ What am I doing wrong?
lordfly is offline   Reply With Quote
Old 20th May 2010, 03:39 PM   #13
lisa
Senior Member
Professional user
 
lisa's Avatar
 
Join Date: Mar 2005
Location: Phoenix, AZ
Posts: 917
Default Re: PLUGIN: Render to Texture: Light Maps, Normal Maps, AO

Quote:
Originally Posted by lordfly View Post
(yes, they're getting honest to god meshes now, instead of sculpties).
*woot*

Quote:
Originally Posted by lordfly View Post
Anyways, when using this renderer, perhaps I'm using it wrong, but the output is either one of three things:

1) A basic texture output (no lighting, shading, or UV mapping)
2) pure black
3) pure white

On one shape I was testing on, I did get an interesting half-texture/half black thing going, but that's about it.

Lights seem to have no effect on any of it. :/ What am I doing wrong?
Hmm. What does your render setup look like?

Also, is your object UV mapped? You need a unique atlas.
lisa is offline   Reply With Quote
Old 20th May 2010, 05:55 PM   #14
lisa
Senior Member
Professional user
 
lisa's Avatar
 
Join Date: Mar 2005
Location: Phoenix, AZ
Posts: 917
Default Re: PLUGIN: Render to Texture: Light Maps, Normal Maps, AO

Oh! Also, are your lights bright enough?

You may need to turn up the intensity, which you can do by adding a color statement to the object properties. Try turning it up to 50 or so, see if that helps.
Attached Images
 
lisa is offline   Reply With Quote
Old 21st May 2010, 12:18 AM   #15
lordfly
Junior Member
Junior member
 
Join Date: May 2010
Posts: 8
Default Re: PLUGIN: Render to Texture: Light Maps, Normal Maps, AO

Quote:
Originally Posted by lisa View Post
*woot*
Yeah, i'm pretty excited. There's more immediate reasons I'm trying ac3d that are "future version" related, but unfortunately i'm under NDA. Basically I want to use something lightweight-yet-useful like AC3d instead of say, Maya or Blender, which is total overkill.

Quote:
Hmm. What does your render setup look like?
This is probably my main problem; I don't think I have a render setup.

Quote:
Also, is your object UV mapped? You need a unique atlas.
Well, I suppose it's just a basic UV setup (ie no input by me)... I have a simple square texture repeated over all the faces, I suppose that's not the right way to do things, else this would be cake.
lordfly is offline   Reply With Quote
Old 21st May 2010, 07:49 PM   #16
lisa
Senior Member
Professional user
 
lisa's Avatar
 
Join Date: Mar 2005
Location: Phoenix, AZ
Posts: 917
Default Re: PLUGIN: Render to Texture: Light Maps, Normal Maps, AO

Quote:
Originally Posted by lordfly View Post
Well, I suppose it's just a basic UV setup (ie no input by me)... I have a simple square texture repeated over all the faces, I suppose that's not the right way to do things, else this would be cake.
The UV map is the problem. What the render to texture tool does is write the lighting information to the texture map. If more than one face is sharing the same area of the texture, the lighting will get overwritten.

You need a "unique atlas"... all that means is that each part of the map is used by one and only one face. You can create one yourself with the TCE built into AC3D, or there are some tools that will make one for you. There's a texture tool called Ultimate Unwrap 3D that will make one automatically. There's also a freebie command-line tool from Microsoft called UVAtlas that will do it. It used to come with the DirectX SDK, dunno if you can download it separately.
lisa is offline   Reply With Quote
Old 24th May 2010, 02:34 PM   #17
lordfly
Junior Member
Junior member
 
Join Date: May 2010
Posts: 8
Default Re: PLUGIN: Render to Texture: Light Maps, Normal Maps, AO

Quote:
Originally Posted by lisa View Post
The UV map is the problem. What the render to texture tool does is write the lighting information to the texture map. If more than one face is sharing the same area of the texture, the lighting will get overwritten.

You need a "unique atlas"... all that means is that each part of the map is used by one and only one face. You can create one yourself with the TCE built into AC3D, or there are some tools that will make one for you. There's a texture tool called Ultimate Unwrap 3D that will make one automatically. There's also a freebie command-line tool from Microsoft called UVAtlas that will do it. It used to come with the DirectX SDK, dunno if you can download it separately.
Hmm; I suppose that's where I'm having the issue. Correct me if I'm wrong, but doesn't "proper texturing" include having the same textures going over multiple surfaces? For instance, say I have a tree made with multiple branches; they are all made of the same material (in this case, bark). Rather than having each surface have a unique texture (and thus eat gobs of memory), aren't you supposed to share pixels between surfaces to cut down on texture memory? Obviously this doesn't apply if you're doing static renders, but I'm pretty sure you have to do that for game rendering.

Thus, if this plugin requires unique UV coordinates for every surface it to do it's thing, it's kind of pointless for games, isn't it? Or am I missing something here? I'm sure I am.
lordfly is offline   Reply With Quote
Old 25th May 2010, 11:45 AM   #18
luuckyy
Senior Member
Professional user
 
luuckyy's Avatar
 
Join Date: Jul 2005
Location: France
Posts: 737
Default Re: PLUGIN: Render to Texture: Light Maps, Normal Maps, AO

Quote:
Originally Posted by lordfly View Post
Hmm; I suppose that's where I'm having the issue. Correct me if I'm wrong, but doesn't "proper texturing" include having the same textures going over multiple surfaces? For instance, say I have a tree made with multiple branches; they are all made of the same material (in this case, bark). Rather than having each surface have a unique texture (and thus eat gobs of memory), aren't you supposed to share pixels between surfaces to cut down on texture memory? Obviously this doesn't apply if you're doing static renders, but I'm pretty sure you have to do that for game rendering.

Thus, if this plugin requires unique UV coordinates for every surface it to do it's thing, it's kind of pointless for games, isn't it? Or am I missing something here? I'm sure I am.
Yes the plugin requires unique UV coordinates for every surface. That doesn't mean it requires a unique texture for every surface in the model.
Put simply, each UV must not overlap with another one on your UV map.

Take a cube, it has 6 faces. If you put all these 6 faces in a unique place on the UV map (and all these UV are not overlapping each other) then it's ok.
But if you put for some reasons, let's say the top and bottom faces at the same place on the UV map (or both are overlapping somewhere) then it's wrong (for a proper use of Lisa's plugin).
__________________
OL.

Last edited by luuckyy; 25th May 2010 at 11:48 AM.
luuckyy is offline   Reply With Quote
Old 26th May 2010, 01:38 AM   #19
lordfly
Junior Member
Junior member
 
Join Date: May 2010
Posts: 8
Default Re: PLUGIN: Render to Texture: Light Maps, Normal Maps, AO

Quote:
Originally Posted by luuckyy View Post
Yes the plugin requires unique UV coordinates for every surface. That doesn't mean it requires a unique texture for every surface in the model.
Put simply, each UV must not overlap with another one on your UV map.

Take a cube, it has 6 faces. If you put all these 6 faces in a unique place on the UV map (and all these UV are not overlapping each other) then it's ok.
But if you put for some reasons, let's say the top and bottom faces at the same place on the UV map (or both are overlapping somewhere) then it's wrong (for a proper use of Lisa's plugin).
Hum; that's what I thought. Kind of unfortunate; I can't properly conceive of an efficient texture/UV map that would accomodate more than a few faces (complex organic shapes would be impossible, such as tree branches). Maybe I'm just visualizing it wrong.
lordfly is offline   Reply With Quote
Old 26th May 2010, 05:28 PM   #20
lisa
Senior Member
Professional user
 
lisa's Avatar
 
Join Date: Mar 2005
Location: Phoenix, AZ
Posts: 917
Default Re: PLUGIN: Render to Texture: Light Maps, Normal Maps, AO

Quote:
Originally Posted by lordfly View Post
Hmm; I suppose that's where I'm having the issue. Correct me if I'm wrong, but doesn't "proper texturing" include having the same textures going over multiple surfaces? For instance, say I have a tree made with multiple branches; they are all made of the same material (in this case, bark). Rather than having each surface have a unique texture (and thus eat gobs of memory), aren't you supposed to share pixels between surfaces to cut down on texture memory? Obviously this doesn't apply if you're doing static renders, but I'm pretty sure you have to do that for game rendering.
Not so. Most games that use lightmaps use two sets of UV coordinates, one for the diffuse map and one for the lightmap. These are combined at runtime using either a multitexturing shader or multipass if all you have is a fixed function renderer. e.g. GL_ARB_multitexture if you're writing something using OpenGL or SetTextureStageState if you're using DirectX. The render-to-texture plugin will allow you to bake both together in case your engine doesn't support multi-texturing, but that's not the normal way it's done. These are normally different maps.

The first set of texture coordinates is for the diffuse map, and is as you describe: overlapping as much as possible to use texture space as efficiently as possible.

The second set of texture coordinates is specific to the lightmap. It's a unique atlas, and the lightmaps are *extremely* low-resolution. It's not uncommon to pack an entire scene onto a single 1024 lightmap, or small 32x32 or 64x64 textures for individual objects. Shadows are normally a little blurry anyway, so the maps can be pretty tiny and still look great. This keeps this method pretty efficient even though it uses more UV space.

AC3D only supports a single set of texture coordinates for a model so if you're building models for a game, you'll want to create two versions of the model file and combine them in your export utility. [Multi-coordinates is definitely on my wish list :-) ] If you're fixed function, keep them as separate models and arrange it as a second pass. e.g. Render the first model as usual, then render the second model with alpha blending and a tiny z-buffer offset to blend the shadows in.
lisa is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT -4. The time now is 07:12 AM.


AC3D Forum
(C) Inivis Limited 2020