surmariusz Posted April 10, 2015 Share Posted April 10, 2015 Hi, is it possible to have more than one diffuse texture put on a given mesh? I would like to get an effect of car tires track in the sand. Quote Link to comment Share on other sites More sharing options...
Wingnut Posted April 10, 2015 Share Posted April 10, 2015 Hi sz! Yes, it is possible to put more than one diffuseTexture per StandardMaterial placed on a single mesh. This is done using multi-materials and subMesh. But this method might not be the best solve for your challenge. What if you put another plane atop the ground... and IT had a tiretracks texture and a transparent background? That would work, right? Our brand new "decal system" has some real nice abilities to do that, or you can do it manually, as well. The BJS decal system was established in this thread and its documentation is right here. If you want the tire marks to be simple black marks on a ground plane, then you may consider using a modified particleSystem... spraying black particles behind the rear tires. You might use a low emit power and medium particle lifetime, and the particle emit direction would be flat and parallel to the ground. The black marks would slowly disappear as the particles reached their maximum lifetime values. You see that these last two methods... DO NOT use the same mesh as the ground. Instead they are ways to place other mesh atop the ground, and each of those other mesh textures has an alpha component (transparent background), so they APPEAR to be part of the ground mesh texture, but are instead... over-layed. If you NEED tire tread patterns, you will need to use the decals method, or manually place planes with tire tread texture... into the scene yourself. Decals are easier, because they have the abilities to conform to heightMapped ground (see the decals-for-heightMaps information and playground demo by bullisor... here). If black marks are fine, and no tire tread pattern is needed, I would use invisible-emitter particle sprayers placed near the base of the tires and parented to something on the car, so they travel along WITH the car tires. Particle sprayers would handle car turns nicely, leaving "curl" patterns when the car is doing "drifts"... and would get longer when the car was going faster... and be shorter when the car is going slower... all automatically. But, you didn't mention a car. Just tire tracks. So, I'm getting ahead of the situation to a degee. If you ONLY need tire tracks and don't need the tracks to be produced at the back of a moving car, then its easy... use decals with tire track textures. Tire tracks made using decals... will travel up over mountains and through rivers just fine... following heightMap contour the whole way, automatically. If you use particles, it will take a bit of tweaking of the particle system so that the particles emit FLAT along the ground plane (parallel to it) and you will need to set the particle gravity to zero so the particles dont fall thru the ground. Yep, it can be done, and in more than one way. Maybe these are not the solutions you had hoped-for... but they will get the job done in a nice realistically-fake way. Good luck. Keep us posted. Others will likely have more comments... so stay tuned. Quote Link to comment Share on other sites More sharing options...
surmariusz Posted April 10, 2015 Author Share Posted April 10, 2015 Thank you for so much. I will try decals for sure. They look really promising. Particles are of not use for me because tire tracks should stay more or less permanently even when you start new game. Ideally I would like to be able to put tracks in such a way that they would be more and more visible after each successive ride. Like when several cars ride one after another on initially virgin beach and after some time you can see something like a dirt road. Quote Link to comment Share on other sites More sharing options...
jerome Posted April 10, 2015 Share Posted April 10, 2015 aren't decals new meshes ?won't it be many many meshes to render after the car will have run a while ? not that easy ... I coded a tiny 2D tank game for my son more than a year ago : http://raphael.bousquie.fr/jeux/tank/jeu2.htmlTanks leave caterpillar tracks on the sand. These tracks are just drawn on a intermediate canvas (2D) which is never cleared. I guess it's not that easy to do in 3D. If you do the same and draw on a big transparent dynamic texture, you will have to deal with each frame texture update performance issues.If you use decals, you will have to manage many new objects. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted April 10, 2015 Share Posted April 10, 2015 Decals can be merged to get perf Quote Link to comment Share on other sites More sharing options...
jerome Posted April 10, 2015 Share Posted April 10, 2015 indeed Quote Link to comment Share on other sites More sharing options...
surmariusz Posted April 10, 2015 Author Share Posted April 10, 2015 I will try decals and will keep you updated on results Wingnut 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.