jim.bourke Posted April 29, 2016 Posted April 29, 2016 I have an issue very similar to one that is discussed in this thread: https://developer.unigine.com/forum/topic/3536-find-decal/?hl=%2Bbunker#entry18675 The solutions proposed in the above thread are not sufficient for us. We want to know detailed information about the decal texel at the points of contact with the ground. The points of contact are relative to a small vehicle. We need to know when a wheel is on a decal or on regular terrain. We've come up with a possible solution: 1. Create a new camera directly above the rigid body of interest, with an orthographic projection. Call this the GroundCollisionMaterialCamera. 2. Each rendering tick render the decals only using the VehicleGroundCollisionMaterialCamera into a texture. Call this the GroundCollisionMaterialTexture. 3. Each time there is a ground contact convert the world x/y to a GroundCollisionMaterialTexture coordinate. Find the color information of the alpha channel in the GroundCollisionMaterialTexture. Use a threshold to determine if the decal is visible or not at that x/y. 4. A further expansion would use the normals at the x/y coordinate instead of the alpha channel. Any pointers or thoughts on this approach? Jim
ataylor Posted May 2, 2016 Posted May 2, 2016 I've begun attempting the solution Jim outlined above. Based on my limited experimentation thus far with viewport masks, it seems that it's possible to render the terrain without any decals, but not possible to render decals without the terrain. Attempting to render only the decals results in an empty image. Is this the expected behavior? We may be able to do two separate renders (one with terrain only, another with terrain + decals) and take an image difference between the two to get only decals, but this seems like a roundabout solution and potentially unreliable. Any advice is appreciated.
silent Posted May 4, 2016 Posted May 4, 2016 Hi Jim, We want to know detailed information about the decal texel at the points of contact with the ground. Could you please give us more details what you really want to get from this decals data? Maybe some screenshots will help us to undertand the use-cae? For example, if you trying to identify the vehicle by the decal diffuse texture - it's probably not optimal solution (as you will need to render the terrain patch also) and will cause performance drop. Attempting to render only the decals results in an empty image. Is this the expected behavior? I'm afraid, yes. Thanks! How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN
jim.bourke Posted May 4, 2016 Author Posted May 4, 2016 Silent, We met today about it. Since it isn't straightforward to try it the way we want we are going to give the object mesh solution a try. We'll get back to you about the decals if we can't make it work. Jim
Recommended Posts