Multi-texture/vertex blending shaders?

Friendly conversations, and everything that doesn't fit into the other forums.
  • 1
  • 2
16 posts Page 1 of 2
Mitovo
Posts: 65
Joined: Sun Apr 12, 2015 5:46 pm
by Mitovo » Wed Jan 04, 2017 2:22 am
Hi all,

I've tried googling, and I saw the question was asked back on the GG site, but the link wouldn't load... Thought I'd ask here.

Has anyone ever put together a shader for multi-texture, using either vertex blending, or perhaps a splat-map type setup?

I was thinking of working on some assets using something like that, but am not sure if T3D would support such a thing.
Azaezel
Posts: 353
Joined: Tue Feb 03, 2015 9:50 pm
 
by Azaezel » Wed Jan 04, 2017 5:08 am
Haven't had time to do more than a bit of basic research on the subject at present, but if somebodys interested, to save em a bit of hunting:
https://github.com/GarageGames/Torque3D ... 1215-L1267

Would be the vertex coloration end, so a variant on that would be with different textures presumably being lerp(basetexture,chaneltexture,colorchanel);
Duion
Posts: 649
Joined: Sun Feb 08, 2015 1:51 am
 
by Duion » Wed Jan 04, 2017 11:03 am
What is the purpose of multi texture blending?
JeffR
Steering Committee
Steering Committee
Posts: 642
Joined: Tue Feb 03, 2015 9:49 pm
 
by JeffR » Wed Jan 04, 2017 9:37 pm
It's similar to how the terrain texture blending works. In fact, that's one of the most common ways to control which textures are where on the terrain - by changing the vertex color values - and is similar to what we do with our terrain.

For more specific examples, it allows you to do stuff like having, say, a brick floor material, and then additional texture maps/materials that blend in as needed like, say, water and snow.

So you'd have your brick floor on your ground, and then by painting vertex color values, can dictate spots to have water and snow accumulation, letting you pick specific parts of the ground to have water puddles, or snow piles.

This can be extrapolated to practically anything. Stone wall with greenry growth or grime, cracks in concrete, etc. Because you select what parts of the surface have the various blends, it allows you to take a common material, and apply minor changes via the blends, adding lots of detail as needed and also helps combat the 'repeating texture' effect. All in all, a very powerful tool for artists to work with to make their scenes unique and interesting.
Duion
Posts: 649
Joined: Sun Feb 08, 2015 1:51 am
 
by Duion » Thu Jan 05, 2017 4:12 pm
I don't see the much use yet, since if you model objects you can have individual textures with everything you can imagine.
Johxz
Posts: 390
Joined: Sat Feb 07, 2015 11:37 pm
by Johxz » Fri Jan 06, 2017 12:53 am
So @
User avatar
JeffR
this is something like texture overlay? but with better control of blend?
JeffR
Steering Committee
Steering Committee
Posts: 642
Joined: Tue Feb 03, 2015 9:49 pm
 
by JeffR » Fri Jan 06, 2017 4:37 am
Kinda.

This part of a video from UDK shows it off a bit:



One of the advantages this method offers is a single material, but nearly infinite variations in surface. This is especially useful in cases where you have a bunch of prefab parts to make buildings. Obviously if you just used the same peices with the same textures, it becomes really repetitive, but having a bunch of different textures uses more memory and adds draw calls. So you could go in there and using one material, paint grime in various spots, breaking up the repetition without tons of additional memory use and draw calls.

The thing that separates it from a simple texture overlay is you can use the normal maps as a contributor, so as the video shows, is when he paints the sand/water, it accumulates in between and at the edges of the tiles first, which is more realistic, and then the flat surface areas. You can also mix and match a few different materials, or have it offset the verts in the very shader to have sand accumulation actually raise off the surface for more depth, etc.

It's a pretty flexible technique.
Azaezel
Posts: 353
Joined: Tue Feb 03, 2015 9:50 pm
 
by Azaezel » Fri Jan 06, 2017 4:49 am
Should note the vertx painting approach specifically (as oposed to a splatmap, which would be a 5th texture where you reference rgba for your blend ops) does require a higher than normal polycount for lookup, pretty much by definition.
JeffR
Steering Committee
Steering Committee
Posts: 642
Joined: Tue Feb 03, 2015 9:49 pm
 
by JeffR » Fri Jan 06, 2017 5:47 am
Yeah, how detailed you can get with the painting is 1:1 with how dense your verts are, even on flat surfaces, you'd need to have them modeled as a grid.
Duion
Posts: 649
Joined: Sun Feb 08, 2015 1:51 am
 
by Duion » Fri Jan 06, 2017 12:09 pm
So you need to add more vertexes for it to work smoothly? Lets assume you have a wall that is juts 4 vertexes, how you gonna blend that?
I wonder how it works that you have one material? I mean you have multiple ones like with the terrain.
It looks a bit like the megatexture approach where you can paint it like you want and in the end it gets baked to one megatexture.
  • 1
  • 2
16 posts Page 1 of 2

Who is online

Users browsing this forum: No registered users and 1 guest