[ 3 / biz / cgl / ck / diy / fa / ic / jp / lit / sci / vr / vt ] [ index / top / reports ] [ become a patron ] [ status ]
2023-11: Warosu is now out of extended maintenance.

/3/ - 3DCG


View post   

File: 704 KB, 1280x729, mot_01.jpg [View same] [iqdb] [saucenao] [google]
517141 No.517141 [Reply] [Original]

Hey /3/, could use some help.

I'm working on a project that's going to have a stylized, rocky environment. I was looking around when I came across pic related and realized it was exactly what I wanted to accomplish. The guy has a bunch of info on his website how he accomplished it, but I'm having trouble wrapping my head around it. Here's how I think he did it.

>sculpt rock
>bake high-res rocks' normals to low-res rocks
>apply hand-painted texture via triplanar mapping
>have a z-up for the sand

The problem I'm having is implementing a similar system in Unity. I'm just stuck trying to figure out how to go about doing it. I can set up a triplanar material in Shader Forge easily enough, but I can't find a way to overlay the baked textured and normal maps over the tiled textures/normals being projected onto the mesh via world space mapping.

Here's the guy's portfolio page where he says how he did it: http://www.digitaldracott.com/SubPage_Motiga.php.. He did it in UDK, but I assume the techniques used can be done in Unity 5 as well with the proper know-how. I feel like I'm right on the edge of understanding how to make a shader like the one he made, but I just can't wrap my head around some of the process. Mainly how to "overlay" the baked normal map with the tiled projected map.

Any help would be appreciated. If this is damn simple and I'm missing something simple, I apologize for my slowness!

>> No.517142
File: 580 KB, 1280x729, mot_09.jpg [View same] [iqdb] [saucenao] [google]
517142

>>517141
Here's his explanation of how the shader works in UDK. I'm having trouble figuring out how he "overlays" the baked normals.

>> No.517143
File: 538 KB, 1280x729, mot_08.jpg [View same] [iqdb] [saucenao] [google]
517143

>>517142
Here are the three textures he used for all of the rocks. I understand how the first two are mapped via world space, but can't figure out how the third one comes into play.

>> No.517144
File: 522 KB, 1280x729, mot_07.jpg [View same] [iqdb] [saucenao] [google]
517144

>>517143
I also don't understand how that one baked texture created all of these rocks.

I tried looking around for tutorials to cover this topic, but came up blank.

>> No.517145

The third might be a matcap type of a thing. It picks a point in the texture depending on the angle between camera view vector and the surface normal. Just a guess.

>> No.517147

>>517144
wait, are you talking about the uv's here? i can see each of those maps on each object, just nicely positioned uv shells i think

>> No.517165
File: 539 KB, 1871x908, 21597-nblend.png [View same] [iqdb] [saucenao] [google]
517165

>>517141
You say you're just trying to overlay a custom baked normal map on top of your triplanar, effect.

Can't you just plug your triplanar normals into an "add" node and then socket your other normal map after multiplying the three-vector like on the left of this image here?

You would do the same with your custom diffuse by just multiplying it with your triplanar diffuse.

>> No.517167

why do you want to copy his shader? just make your own shader

>> No.517168

>>517167
also:

>stylized textures
>all this complex baking process of baking normals from pictures instead of using pbr workflow

>> No.517178

>>517167
>>517168
yeah you're both stupid

>> No.517182
File: 651 KB, 1104x958, seams.png [View same] [iqdb] [saucenao] [google]
517182

>>517147
Yeah, I can also see where the UVs are mapped to each rock. The thing is there's so many different kind of rocks with such a simple normal map. How could you get such nicely positioned uv shells to only have to use one, simple normal map for so many rocks? Obviously it's a method I don't know about.

>>517165
This is exactly what I was looking for, thank you!

The only problem I'm running into now is an ugly seam in my tiled, triplanar projection. If I set the shader's normal space to "tangent", my baked normal map works (the baked map is in tangent space). However, the triplanar map is obviously in world space and creates ugly seams at the egde of my uv shells. This can be fixed by setting the normal space to world, but then the baked normal no longer works since it is in tangent space.

I'm trying to figure out how to have both maps work in either world or tangent space. It could be a really simple process, but I just don't have the knowledge or know what to look for in tutorials.

>pic related, a sample mesh with the seam issue

>>517167
>>517168
I'm a novice when it comes to shaders and materials. I would rather follow the example of somebody who is a professional than try to blaze my own path. At least at the moment, that is.

>> No.517210
File: 317 KB, 1337x709, 20140318091005!Triplanar_mapping.png [View same] [iqdb] [saucenao] [google]
517210

>>517182
Here's a triplanar setup for your reference in shaderforge. I dont know what you've done on your end.

>> No.517212
File: 170 KB, 1225x847, triplanar.png [View same] [iqdb] [saucenao] [google]
517212

>>517210
Here's my triplanar setup right now.

I'm still having issues blending the two normals because the triplanar is using world space normals while the baked normals are using tangent space.

The bit circled in red is the baked normal. Everything in black is the triplanar projection for the normal maps. The blue circle is where they're mixing. That's an Add node right now, which does mix them, but not very good.

The big thing is I'm trying to get the triplanar projection to work with the shader's normals set to "tangent". Right now they only work if the shader is set to world space normals.

>> No.517220

>>517212
Figured it out; I needed to convert the triplanar output from world to tangent before adding it to the baked maps.

Working perfectly now.

Next up: blending textures. Luckily I have experience with that, so it shouldn't seem to foreign.

>> No.517392

>>517141
>>517143
how did you do for the normal map and the painted texture ?
like, did you make the textures from the blue things (normal maps ?) or was it something else ?
i'm new to 3d and i love the way it looks

>> No.517414

>>517392
I'm not the guy who did that. I was referencing his portfolio page.

He probably painted the texture first then did the normal map in nDo.