|
i have an object which has a diffuse detail material attached. i want to be able to change both the main texture and the detail texture at different times. how would i refer to each element to do so? (the scenario is a car which changes colour on the main texture, but also gets dirtier on the detail texture this is the code i am using to change the car colour on the main texture thanks
(comments are locked)
|
|
Use Material.SetTexture(). To know the name of a texture you will need to look at shader code used by the material. For builtin shaders take a look here. The code for a material using Diffuse Detail would be: thankyou for that. I've used the _detail and an array to change them. do you know how i could fade between 2 details?
Jan 16 '12 at 11:50 AM
mehowe7
I can think of 2 ways: 1 - create a texture dynamically that mix 2 detail textures you want to fade. 2 - write a shader, based on the built-in, that takes 2 textures instead of 1 and interpolate between them. I don't know how are you planning to use it, but I think the 2nd approach would be better in most of the cases. It requires some shader programming skills though.
Jan 16 '12 at 02:43 PM
luizgpa
I have gone with option 2, thank you. the shader has a main texture with 3 overlaying details. I'm just working out now how to apply alpha channels to the details to fade each one in
Jan 16 '12 at 04:32 PM
mehowe7
(comments are locked)
|
