Viewpoint Developer Central    Viewpoint Forums    Viewpoint Forums  Hop To Forum Categories  Viewpoint Modeling    MultiUV and static lightmap

Moderators: e_phoenix13
Go
New
Find
Notify
Tools
Reply
  
-star Rating Rate It!  Login/Join 
Member
Posted
Hi,
According to the Viewpoint documentation you should be able to use MultiUV="1" attribute in MTSInstance to pin down the lightmap if the geometry has two sets of UV coordinates.. What I'm trying to do is to use the lightmap as a static shadow layer on top of the textured geometry. However I don't seem to be able to get this to work. Does someone know how you can add the second set of UV coordinates to get the MultiUV behaviour to work?? I'm using 3DStudioMax to create my models.

-Henkka
 
Posts: 25 | Registered: January 09, 2006Reply With QuoteEdit or Delete MessageReport This Post
EnIgMaTiCScOrPioN
Member
Picture of e_phoenix13
Posted Hide Post
Hi !!

In 3D Studio MAX, assign different material IDs. These IDs will come along in VET. Then you can assign the same or different lightmaps to the textures with different IDs.

Hope this helps.



Cheers,

Anup
 
Posts: 557 | Location: India | Registered: February 12, 2003Reply With QuoteEdit or Delete MessageReport This Post
Member
Posted Hide Post
Hi,
Thanks for your reply! However I think that we might be talking about different things.. Let me try being more specific. :)

Assigning multiple materials with different IDs to a single geometry is working OK. What I'm trying to do is having layered textures on a single geometry. Ex. Let's say that you have a simple plane and you use tiled diffuse texture and some lightmap on it. Now if you take it to the Viewpoint the lightmap gives the object the feeling of global lighting effect that changes when you view the object from different angles. According the VET docs you can disable the default lightmap behaviour by setting the MultiUV="1". This should pin down the lightmap giving the object an effect of 'baked' static lighting. The documentation does not give you specifics what the actual steps are to achieve this. It just mentions that you need to have a second set of UV coordinates that the lightmap can use and that you need to set MultiUV to 1.

I have tried multiple different ways in 3dsmax to get this working but I don't seem to get it right.. Does anyone know what the actual steps are in 3dsmax to get the baked lightmaps to work??

-Henkka
 
Posts: 25 | Registered: January 09, 2006Reply With QuoteEdit or Delete MessageReport This Post
EnIgMaTiCScOrPioN
Member
Picture of e_phoenix13
Posted Hide Post
Hi !!

Which document are you refering to?

Cheers,

Anup
 
Posts: 557 | Location: India | Registered: February 12, 2003Reply With QuoteEdit or Delete MessageReport This Post
tao
Member
Posted Hide Post
I'm also interested to get a working example of this property.

You can get informations here :

http://reference.viewpoint.com/cr/p.php?id=384

or

http://developer.viewpoint.com/dc/docs/vwpt_authoring_guide.pdf
page 74

Regards,
Lionel
 
Posts: 19 | Registered: January 24, 2003Reply With QuoteEdit or Delete MessageReport This Post
Member
Posted Hide Post
Hi,
Information about MultiUV can be found:

1. vmp_315_relnotes.pdf, page 68
2. Viewpoint Code Reference: http://reference.viewpoint.com/cr/p.php?id=384&ti=19

-Henkka
 
Posts: 25 | Registered: January 09, 2006Reply With QuoteEdit or Delete MessageReport This Post
Member
Posted Hide Post
Halloooo!!
Anyone have any ideas how to get the MultiUV to work?? I REALLY need to get this solved before we can recommend Viewpoint to a specific customer case.

Regards,
-Henkka
 
Posts: 25 | Registered: January 09, 2006Reply With QuoteEdit or Delete MessageReport This Post
Member
Picture of Admin
Posted Hide Post
Hi, Henkka

I'm looking into a way to get layered uv's onto a geometry directly in the mts file. But I'm waiting for one of the engineers to get back to me on it. In the meantime, I would like to ask you a few questions.

Usually the reason you would want to have layered textures is because one or both of them need to change independently of the other in some way. Is this why you need to have the shadows on a separate texture layer? Will the shadows be changing dynamically in relation to the underlying texture? If not, is it possible to just "bake" your shadows into the texture in 3DS Max instead?

Just trying to get an idea of what you want to do so I can see if there's an alternative I may be able to offer you.

Thanks,
Viewpoint Support
 
Posts: 1188 | Registered: January 08, 2003Reply With QuoteEdit or Delete MessageReport This Post
Member
Posted Hide Post
Hi,
Thanks for your reply! Yep - We need the layered texture with static lightmap because we need to have an ability to change the underlying diffuse texture dynamically. New diffuse textures will be added by our customer (ex. floors, tiles, fabrics) and we need to make adding a new texture as painless as possible. Using texture layers will also reduce the overall download time since you can use lower resolution image to create shadows and still maintain good quality on the diffuse texture.

Regards,
- Henkka
 
Posts: 25 | Registered: January 09, 2006Reply With QuoteEdit or Delete MessageReport This Post
EnIgMaTiCScOrPioN
Member
Picture of e_phoenix13
Posted Hide Post
Hi Henkka !!

Changing a texture dynamically does not require a static lightmap or layered UVs. You can have a texture change animation even if you have a lightmap applied to the texture. Is there any other specific reason to keep lightmaps static and on a different layer?

Cheers,

Anup
 
Posts: 557 | Location: India | Registered: February 12, 2003Reply With QuoteEdit or Delete MessageReport This Post
Member
Posted Hide Post
Hi Anup,
You are right.. Changing a texture dynamically does not require layered UVs. You need them if you want to have a static lightmap representing shadows and a diffuse texture giving a feeling of the surface. By static I mean that the lightmap position remains the same in relation to the diffuse map regardless which angle you are viewing the model from.

Example:
Let's say that you want to create a model of a room with pine floor. You also want to include the shadows / highlights caused by the windows, walls and other objects. If you rotate the room (view it from the different angles) the shadows in the room should stay static.

One way to create this is to render (aka bake) the pine floor texture with shadows in 3dsmax. Now you have let's say 512x512 pixel pine texture with shadows applied to the floor. Next step would be to export the scene to VET, set the RenderMode to flat to disable the default lightmap and you would be set. However the problem with this approach is that now if you want to change the floor from pine to maple you need to go back to 3dsmax and bake another floor texture. This also causes that when the end user wants to view the room with maple floor he needs to download another 512x512 texture.

Another alternative would be that you render / bake the shadow texture separately from the pine / maple map. Now you end up with (ex. 256x256) texture just containing the lighting info (shadows). Next you would add the generated ‘lightmap’ in to the VET scene. This ‘lightmap’ should however stay static when the model is rotated / viewed from the different angles. Then you want to add tiled pine texture ex. 64x64 to the floor as diffuse map. Both of these layers need a separate set of UV coordinates to get the layered texture effect. According the Viewpoint docs this should be possible (MultiUV=1). The benefit of this approach is that now when you want to add the maple floor option to your application you just create a new maple tile in PhotoShop and hook it up with your app. Also now when the end user changes the texture from pine to maple he needs to only download a single 64x64 maple tile instead of baked 512x512 map containing the shadows.

Regards,
-Henkka
 
Posts: 25 | Registered: January 09, 2006Reply With QuoteEdit or Delete MessageReport This Post
Member
Picture of Admin
Posted Hide Post
Henkka,

Would duplicate geometry work for you? -- have one geometry just for a shadow layer that you apply with an alpha map and the second geometry for the textures you want to swap? Just checking.

Viewpoint Support
 
Posts: 1188 | Registered: January 08, 2003Reply With QuoteEdit or Delete MessageReport This Post
Member
Posted Hide Post
Hi,
It would be one option. In my case the scene is fairly big and I would rather use as few polygons as possible.. This would approximately mean doubling the poly count.

-Henkka
 
Posts: 25 | Registered: January 09, 2006Reply With QuoteEdit or Delete MessageReport This Post
Member
Picture of Admin
Posted Hide Post
Hi Henkka,

We believe we found a way to do it. But I'm still getting final instructions from the engineers. Sorry it's taking so long, but they need to get permission for a couple things before we can disclose it. I hope we're not too late on addressing your concern. Could you please send an email to techsupport@viewpoint.com with your concern and address it to Craig. I'll need to communicate with you through email for the solution.

Thanks!
Craig
 
Posts: 1188 | Registered: January 08, 2003Reply With QuoteEdit or Delete MessageReport This Post
Member
Picture of Admin
Posted Hide Post
Ok, so I thoroughly investigated your question. After looking over the
multiuv method I found what I think is a much easier, more reliable, and
more customizable way to do what you seek.

The multiuv method has turned out to have too many problems and is too
complex to implement since it is an untested feature. So after thinking
it over, I remembered about using the pixl (pixel) property of textures
to do texture blending.

Basically, you set up an animation that fades between the two textures
you want to layer and then pause the animation halfway through so you
end up with a blend. You can pause the animation to have a 50/50 blend,
or a 20/80, 40/60...whatever you need.

Then you can just change the path of the either of the blended textures
to swap out as many different textures as you want.

I attached an example. Please look it over and send back any questions
you have. I fully commented the mtx to explain what I am doing.

Regards,
Viewpoint Support

Zip/GZ archivetexture_blend_code.zip (305 KB, 24 downloads)
 
Posts: 1188 | Registered: January 08, 2003Reply With QuoteEdit or Delete MessageReport This Post
  Powered by Eve Community  
 

Viewpoint Developer Central    Viewpoint Forums    Viewpoint Forums  Hop To Forum Categories  Viewpoint Modeling    MultiUV and static lightmap