Hi,
I’m looking for a map that will let me change the way a certain bitmap is laid out in the uvw space inside the material, kind of like how the output map works. This way I can have a couple of instances of the same bitmap all laid out differently. Can this be done in 3dsmax?
Are you talking about multiple UV maps? When you map anything in Max you can choose another mapping channel, so you can have multiple UV mappings.
There is a menu item also called “channel info” which allows you to view what data is where and copy/paste the data.
How you then decide to us this with a material is a different matter, it depends on your final aim, for rendering or realtime.
no, this is not what I was talking about, I’m talking about using the same bitmap map a couple of times and every time assigning it to a different channel or tiling it differently or rotating it or offsetting it etc. But it’s still the same bitmap, so that if I change one of them, it automatically changes in all the other instances, and this way the computer will use less memory as well because it will only need to load one bitmap.
You’ll want something like a UVWxForm but in a shader. I seem to rember there where some mental ray shaders that could alter UVW settings, but I don’t know which… don’t think there’s a default max material/shader that let’s you override the UV’s… I could be wrong. If you use mental ray head over to the mentalray thread on cgtalk, maybe there’s some answers there…
-Johan
So you want to transform/rotate/scale UV’s in the bitmap?
You just put your bitmap in a map slot like diffuse, click on that map
and then there are options at the top to do this.
you can also select which UV channel that bitmap uses inside
http://www.vigville.com/forum_images/3dsMax_BitmapMapChannel.jpg
See the options like tile/rotate/offset. These then are applied to whatever mapping you are using
mikiex - this is exactly what I’m talking about, I don’t want to set this parameters from inside the bitmap map, I want to set them from outside, like I can do with the output map.
I still dont understand the problem you are having, can you give us a better idea of the end result you want to see in the viewport?
There is a UVW xform modifier, or you can edit uv’s with uv unwrap
I’ll try to give a simple example.
Let’s say I’m creating a shader that have a mix map for the diffuse map.
The firs map in the mix map will be a bitmap called “test.jpg”. Now let’s say I want the second map in the mix map to be the same bitmap (“test.jpg”) only tiled differently or rotated or using a different uvw channel. Now if I replace the bitmap in the first map from “test.jpg” to “anotherTest.jpg”, the map on the second mix map stays “test.jpg”. Plus the computer handles them separately. I want them to be instances of each other so that if I replace one of them the other change as well but they will still be able to have different uvw settings.
I hope that this is clear enough.
You can instance the slots in a Mix map, but that instances all the settings, not just the bitmap path, so you can’t have have different map channels/UV offsets etc. If you’re using Max, I think the only way you’re going to be able to do this is by writing your own scripted material.
Seems a bit heavy handed just to save yourself a couple of extra clicks, but if your actual use case is more complex than the example you gave it might be worth it.
I think I see your problem, you want to instance bitmaps but have different uv values, I suspect this is impossible as Drea says.
Your channel UV settings in the texturemap:bitmap will also be instanced.
It Maybe that Max handles bitmaps, so if you make copys of a bitmap instead of an instance, then you still save memory. I couldnt confirm that without testing it. I dont see the problem with just copying the bitmap?
The problem starts when you try to do some complicated stuff and everything gets messy. I think I found what I was looking for in mentalray, but I can’t figure out how to use it. It is a map called “UV Generator”. Can anyone explain how to use it?
[QUOTE=tzmtn;1313]
Let’s say I’m creating a shader that have a mix map for the diffuse map.
The firs map in the mix map will be a bitmap called “test.jpg”. Now let’s say I want the second map in the mix map to be the same bitmap (“test.jpg”) only tiled differently or rotated or using a different uvw channel. Now if I replace the bitmap in the first map from “test.jpg” to “anotherTest.jpg”, the map on the second mix map stays “test.jpg”. Plus the computer handles them separately. I want them to be instances of each other so that if I replace one of them the other change as well but they will still be able to have different uvw settings.
[/QUOTE]
- Put a Mix map in the Diffuse channel.
- Put a Bitmap map in the Color#1 slot.
- In that Bitmap, load test.jpg.
- In the Mix map, copy (not instance) the Bitmap from Color#1 into Color#2.
- In the Color#1 Bitmap, change Size spinners in the Coordinates rollout.
- In the Color#2 Bitmap, notice it retains its own settings, but it still loads the exact same image file.
Is that not what you want?
No this is again not what I was talking about.
I’ll try to give an example with the output map.
- Create a standard material.
- Add a mix map to the diffuse channel.
- Add a bitmap to the firs map in the mix map.
- Add an output map to the second map in the mix map.
- Copy the bitmap from the first map and paste instance into the map slot inside the output map.
- Change the settings on the output map.
I want to do the same, but to be able to change the uvw settings instead of the output settings.
OK, gotcha, just wanted to be sure. Scripted map plugin would be the way to go then, I don’t see anything on maxplugins.de for this, though I dimly recall having this type of control somewhere.
Ah yes, it was in our own scripted map plugin! Can’t share it, but shouldn’t be too hard to code one up.
So you’re saying it is possible to do this through mxs?
I thought the scripted plugin maps can only alter existing maps ui.
I’ll check it out, thanks!
The map type Bitmap is an existing ui, we used it as the base for a custom one. Not sure if you can use it as a pass-thru though.
OK I think I see where your going here, but when I started to work on this I have discovered something that looks interesting. The coords parameter inside the bitmaptexture map.
from the max help file:
<Bitmaptexture>.coords StandardUVGen – alias: coordinates
See UVGenClass for the StandardUVGen properties.
can anyone tell me a bit on this thing and if it can be used to do what I’m looking for.
I think I should post this question in the cgtalk mxs forum as well.
UVgenclass is auto generated for certain texturemaps, you can’t make your own as far as I know.
What advantage do you hope to gain by instancing a bitmap vs copying it as Eric says?
Its still the same bitmap
Yep why bother with the instance?
You could use a fx file that is doing the blend in pixel shader :
This would also have the advantage to actually show you the mix in the viewport…
sampler2D diffuse;
float repeat1;
float repeat2;
float2 offsetUV1;
float2 offsetUV2;
float mix_amount;
float4 ps_main (in float2 uv : TEXCOORD) : COLOR
{
float4 mix1 = tex2D(diffuse,IN.uvrepeat1+offsetUV1);
float4 mix2 = tex2D(diffuse,IN.uvrepeat2+offsetUV2);
return lerp(mix1,mix2,mix_amount);
}