rn216ccc Posted March 17, 2016 Share Posted March 17, 2016 Hi. My name is Bob. I am new to the Torque3d community. Prior to joining this community, I tried using the GarageGames forums to ask about Multi-UV tiles. I had mentioned that I was new to Torque3d, and before I had started anything, I wanted to know if Multi-UV tiles with texture blending where supported In Torque3D. After posting, one member had mentioned first I should be asking these types of questions over in this board. Secondly, it would be better to use a texture atlas on these type of objects that require large texture space. I thought that this was good news up until I tried doing the FPS demo tutorial. After opening the scene, I have noticed that most of the buildings had multiple materials applied to them instead of using either of the 2 methods above. Firstly, this confused me as I have learned in the past, that using multiple materials causes more draw calls. Isn't this correct? In addition, I have another confusion with the most current 3D model I am working on. This object is an ambulance, which uses Multi-UV tiles, and now that I saw the demo scene using multiple materials, and was also told to use a texture atlas, I am wondering what would be the best method for current project. To help expedite this, down below is a screen shot of my UV tiles off from my current project. Quote Link to comment Share on other sites More sharing options...
Azaezel Posted March 17, 2016 Share Posted March 17, 2016 I thought that this was good news up until I tried doing the FPS demo tutorial. After opening the scene, I have noticed that most of the buildings had multiple materials applied to them instead of using either of the 2 methods above. Old samples are Old, and haven't really had anyone with time to do up a best-practices pass on em to date. Firstly, this confused me as I have learned in the past, that using multiple materials causes more draw calls. Isn't this correct? You are indeed indeed correct. To be a bit more explicit there, each material on a given object effectively forces that to be rendered as an additional mesh, which can break batching, so the more you can fit (within reason) on a given sheet, the better.From a practical perspective, this may be unavoidable if you wish to use separate techniques on a given subsection of an object, say, emissive glowing headlights behind which you'd attach an actual light source are best done as a separated out mat to name a common cornercase involving vehicles.Not entirely sure I follow the tile 1-3 bit. Mind further elaborating? Quote Link to comment Share on other sites More sharing options...
rn216ccc Posted March 17, 2016 Author Share Posted March 17, 2016 Not entirely sure I follow the tile 1-3 bit. Mind further elaborating? sure, but bare in mind that this is a difficult task to grasp on the first try, and I do not have access to my 3D model, so I have created a simple sample. so on with the concept...One way I know of is by lerping the 3 tiles together. Firstly, there are a few things you need to prepare for the lerping. Firstly, looking back at the image in my first post, tile 1 is in the 0,0-1,0 space, tile 2 is in the 1,0-2,0 space, and the third tile is in the 2,0-3,0 space, Next, this method requires 2 UV channels. The first channel will have the 3 UV tiles, and the second channel is a duplicate, but it is scaled to fit all three tiles in the 0-1 space.The last thing you will need is a 4x4 pixel image. Starting from top-left to top-right, and bottom left...the first pixel would be colored in fully red (left-top), the second pixel (right-top) would be set to fully green, and the third pixel (left-bottom) would be set to blue.this 4x4 pixel image will be your RGB mask.Now, when lerping,....you will need to somehow separate the R G & B channels of your rgb image mask, and the UV channel is set to channel 2. With the UV texture tiles, they will be set to UV channel 1. Then taking the first lerp, tile_1 is connected to slot a and tile_2 is connected to slot b, and the Green channel of your image mask is connected to the mix factor in the first lerp. Then the result of the first lerp will connect to the second lerp in slot a, and the third tile is connected to slot b, and the Blue channel of the rgb mask image is connected to this second lerp mix factor. If that is not confusing, it sure is a tongue twister. Believe me, this theroy took me 2 days to figure this out. So do not feel bad if you do not get it on the first try.here is the sample I have promised.... Quote Link to comment Share on other sites More sharing options...
JeffR Posted March 17, 2016 Share Posted March 17, 2016 Hm, not sure I'm following, unfortunately :)Do you have an example of that this would do in practice? As in, what the end result would be? Quote Link to comment Share on other sites More sharing options...
rn216ccc Posted March 17, 2016 Author Share Posted March 17, 2016 Unfortunately, not in Torque3D, as I have never used Torque3D. I am asking these questions in advance, so that I know how to prepare my objects that require large texture space. However, I can point you to a video tutorial using UDK, if that would help. This is where I had learned this technique, when I was using UDK, but I eventually stopped using it because it does not have a road editor and for other reasons as well. Quote Link to comment Share on other sites More sharing options...
rlranft Posted March 18, 2016 Share Posted March 18, 2016 Looks like one model, one atlas texture, multiple pieces of unwrap. So, basically, just a standard single UV unwrapped texture.Unless you're packing multiple model data into a single texture? I mean, no reason you can't do that I guess, just UV map different models to different parts of the same image.... Quote Link to comment Share on other sites More sharing options...
rn216ccc Posted March 18, 2016 Author Share Posted March 18, 2016 Looks like one model, one atlas texture, multiple pieces of unwrap. So, basically, just a standard single UV unwrapped texture. Sort of. The concept is to have the same number of textures, as you would with your UV tiles. This gives you better control because each textures per-tile can be set at different resolutions. So, in the above example, there are three UV tiles. Therefore I would need three textures. Each of the three textures, I could set my first texture at 512x512, and the last 2 textures could be set to 1024x1024. However, if all of the textures are at the same resolution, say something like 512x512, then your probability would make more sense, since 512x512 x 3 = 1536x1536. So in reality with this scenario, you are not saving on texture memory. Quote Link to comment Share on other sites More sharing options...
Janders Posted March 18, 2016 Share Posted March 18, 2016 Short answer, not, it cannot.Multi-UV tiles with texture blending are not supported in Torque3D. Not even multiple UV's per object, neither node material editor. Sadly Torque3D is in prehistoric ages in that regard. 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.