[020] Avoid UV-Unwrapping with TRIPLANAR MAPPING! | CINEMA 4D TUTORIAL | OCTANE, REDSHIFT | Eng

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey guys this tutorial is going to be all about avoiding uv unwrapping i'm going to talk about three different renders here i'm going to talk about my weapon of choice octane i'm going to talk about redshift and i'm also going to show you some neat little tricks in the c4d standard renderer so let's have a look at what we're gonna do today first of all i'm gonna have a look at octane and how to set up the tri-planar mapping this is a method which lets you avoid uv unwrapping in most cases i would say by projecting a texture from different sides on your object and blending the edges together i'm also going to show you how to use the tri-planar node in conjunction with displacement because there's a little catch that you can avoid and i'm also going to show you how to map decals onto your object without the need for uvs then i'm going to show you in redshift renderer how to set up the tri-planar mapping just basic settings how to set it up in general and then we are going to have a look at the good old c4d standard renderer that doesn't come with tri-planer but there's a method how you can set it up yourself so stay tuned and let's get going all right we have this little scene here with this test object is just a little logo cut out here and we want to project our texture here without using uv mapping so how to do that well first of all i'm just gonna create a basic octane glossy material and gonna open up the node editor and of course i'm going to need a texture that i can use here so i'm just gonna drop in this little fabric texture from the other screen that's just a basic texture that i got from textures.com you can see it here on the right and first of all i'm just gonna plug it into the diffuse here and then i'm gonna drop the material onto my object here well here we are lucky i've already uv mapped this so it doesn't look too bad but let's just pretend we don't have this here at all so this is not working very good as you can see so to avoid this we can just use the tri-planar node here which is on the left here at this kind of reddish area and it's this node here tri-planar which comes from three different planes that are used to project the texture on your object so to use it now i'm just gonna plug this in maybe here into the second input so i can explain you what it's doing and you see this input here is called x minus and the other ones are called x plus y plus and so on this corresponds to the object axes in this case so we have x facing from left to right y facing from bottom to top and z from left to right and this is the way that the tri planar is mapping your texture the direction that it's using so using x minus would mean negative x axis so everything that's facing to the left so this corresponds with the normals of your surface here so by using the x minus input here we now should see our image on every angle on every surface here that is angled 90 degrees to the x-axis and facing to the left so let's just try this out and to use the triplaner properly we also have to set up a projection node here which we get by just clicking the image texture node and going to projection and then in this little note we're going to set the texture projection to try planar now to control the size of everything we just go again to the image texture node and set up a uv transform too and now we can see that it's already working as it should so every surface that is angled to the left that it's facing in negative x direction gets this texture now but the texture is very much scaled up so i'll just go to the transform node here and scale it way down to say 0.05 i think yes this is okay so now we have set this up of course in many cases you would just want to set up your texture facing in every direction at once but of course you could also set up if you wanted six different textures here um to use the texture in every direction equally you don't need to connect every input here you can just use the first input disconnect the second one again and then just activate single texture in the triplanar node so then every other node here every other input gets this value from the first input so your image is projected in every direction at once of course you can also set up the coordinate space to world so we don't use the objects axes to project our images but instead we use the world coordinate system which is fixed as you know so if we were to animate our object now the projection of the texture stays fixed and it doesn't move and it looks like we maybe would have set up a beamer that is projecting the texture onto this object here so maybe a neat little effect i don't need it here so i'm gonna set it back here to object coordinate space okay obviously this doesn't look very good but it's i think fine to demonstrate how the tri planar is working so just to sum it up get your tri-planar node here set it to single texture if you want to use just one texture on every surface other than that you could just plug in all the other textures here and do the other input nodes and set up a texture projection node to try planar so this is all mapped correctly if you don't do this you might get some strange projection errors and use a transform node to scale your image the right way because in most cases at least for me the textures are going to be projected way too big so we need this transform node to just scale it down the way we want to okay so so this is how to set the tri planar in general and in the next step i'm going to show you how to use displacement together with tri-planar all right so i've reseted everything so we can start from scratch and everything can be fastened to your memory a little bit better so i'm gonna redo the steps that i've did before i'm gonna create a new material i'm just gonna set up a basic color and roughness so everything is calculated very fast so we can see what we are doing here for the tutorial and i'm gonna go into the node editor now and first of all i'm gonna need my displacement texture i'm just gonna get this very quick here from my other monitor that you cannot currently see now i've found it this is my texture you can see it here in the little thumbnail preview and i'm gonna set up the tri-planar again i'm gonna connect it here to the x plus input and activate single texture here so it's displayed on every axis and i'm also going to set up the projection and the transform node again set the projection node to triplanar so that everything will be mapped correctly now we could already activate the displacement node here but i don't want to plug it in for now because displacement is always kind of a heavy thing to render and i don't have much control about how everything is looking if i just plug it in at this point so to get an easy preview on what will be happening with our material here and with our texture i'll just gonna drop it into the diffuse channel here so now i can see the black and white of the displacement texture and set it up as i want to before plugging it into the proper node here so we see this is way too big i'm gonna go to the transform node and scale this down to say point zero five well this is still too big point zero three this is okay i think and i only want to have the texture one time on each side and not like this not tiled so i'm gonna go to the texture note itself go to the border mode and here i have different settings that i can use and i want to use the white color so this means i only have the texture one time on each side and the rest is filled with white so everything stays exactly the same i also don't want it to be on those front faces here so i'm gonna have to undo the single texture option here in the triplaner and i have to connect it manually to these inputs here but which inputs to choose well the triplaner is set to the object mode here as you can see here in the transform settings coordinate space object so this means those axes that i can see here are the ones that the triplaner is using and i don't want it to be using the blue z axis here which is facing to this forward facing polygons here so i'm just gonna use x and y and not use that and to be sure that everything will be mapped correctly i'm just gonna use a white totally wide 100 percent rgb spectrum node here so that i know which way the top side is looking here now everything is wide except my logo here on those four sides all around this object and this is what i want to have so i can disconnect it again here and plug it into the displacement and as we see we don't see anything because unfortunately at least in the version i am using i'm using the latest octane release as of february 16 february 2021 so there is no texture displacement possible with the tri-planar node but however vertex displacement is possible and that's the node that you need the type here of displacement but first of all i'm just going to change the level of detail because i'm using a 1000 by 721 texture this is not very high obviously you would need much higher resolution for very good displacement but since i at least have those thousand pixels here i'm gonna increase my level of detail to say 10 24 by 1024 so that octane uses the texture in all of its resolution so now i'm gonna activate the vertex displacement and you can see the displacement happening it's not the thing i want here so i'm gonna reduce the height to say 0.5 centimeters and i can see my logo being embossed here but i'm gonna go to the default camera as you can see this is not looking very good um we just have polygons are flying all around here and this is because now as i said it's not texture displacement it's vertex displacement so it's working so to speak with the real polygons and um the the resolution of the mesh is way too low to get this fine structure here so first of all what we can do we can increase the resolution of our subdivision surface here so if i go to object i can play with this setting but it's already set to five so this is a really high value i don't even know for sure if this has a very strong impact on the result that octane render gives you however you also have this subdivision level here and this is the lever that you can engage so to speak to to increase the resolution here and to improve your result but a word of caution this massively increases your vram usage so don't overdo it only go in small increments of one and try what's working for you because it might crash octane if you are using a value that's too high and uh overflows all your vram that you have available i'm also gonna use this mid level here and set it from zero to one so i'm not bloating up all the geometry here and the object itself stays as it was and it's only embossed here on on the side so i'll try a subdivision level of four however i've tried a level of five in the previous attempt and it crashed my octane so for me at least it won't get better than this if you have a maybe a newer rtx 3090 you're going to have a lot of vram and can of course use this so to sum it up this is not a method you want you want to use for very detailed displacement and as you can see this logo is it's flipped from left to right so i didn't consider this when setting this up i would have needed another transform node here so that it's displayed the right way it's here on this side i think it's correct i know it's well okay you you have a little bit of control here by using this transform node that's how you can control the projection of your displacement texture but by using the vertex displacement it's not possible to use very fine structures so now now it's displaced correct you could also see how long it took octane to update the scene because all the geometry had to be loaded into the vram so yes use with caution but it's possible to use with triplaner and if your scene allows it so like this if you're far far away far enough away then this definitely works and i think it's a quick and easy method to use so next step we are going to have a look at how to map decals on our geometry without the use of uvs so as you can see i've switched scenes so i can demonstrate what i'm i want to show you with this midi controller you can already see some details applied on this on these buttons here you can see the the text written on them you can also see it over here and what missing for the moment is this logo here and all the rest of the text for all the other buttons and i'm gonna show you how you can set this up without using uv unwrapping which could be handy if you for example have a cat object which tends to be very tedious to unwrap or you just don't want to unwrap your model then you can use this method here so first of all how do you get this texture well i've just used a basic rendering with a c4d standard renderer from the top here and saved this so just set up your camera to a position where you can look in the same direction as the decals would be facing later on and render this really really basic without beautiful settings or something just quickly get this render have a look that you're setting your camera up correctly don't do it by hand use the cordon manager and set it up really 90 degrees to the surface so you don't get any distortions then you as i said can save a basic image and use for example photoshop to create a new layer where you would enter all the text or the decal stuff i don't know what whatever you want to put on your object if you then have saved your texture it might look like this here for example you can see all the elements here that are going to be visible on my object so that's the texture i'm working with and now we're gonna use it in this scene here so to do this i'm just gonna create a new material here go to create new glossy material however you can choose whichever material you like but i'm just gonna use a glossy one here i'm gonna open up the note editor and it's just one simple step i'm just going to use this texture now and drop it in so here's the texture i'm just gonna drop it in have this image texture node here and connect it straight to not the diffuse but the opacity so now this material which would have been all white covering the whole object in white now only covers the object where this texture is white and where it is black it's not applying this texture it's basically just an alpha mask you might know this from photoshop so just make this connection here and you're almost done go to the image texture node and set the border mode to black color so you don't get a tiled texture but rather just one single texture that is applied the well at the center of your material at the center of your object and now we are almost ready with setting this all up if you want to change the text color you can of course set another diffuse color here which will then be masked with this texture here or if you are using a real decal so to speak like a logo of a of something or an image then you would of course have to plug the alpha channel into the opacity and the regular rgb image into the diffuse here okay so now that we have set this node system up which is really super basic we can just drop this here onto our existing object and be sure to set this material to the right of the already existing material then select the material tag and go down to the projection and set it to flat this will just flat project our decal onto the object without distorting it in any way and we can already see things happening here but this is not what we want and it's looking like this because if we change the mode here to the texture mode and zoom out a little bit then we can see the way our material is mapped here and it's mapped along the z-axis so it's only mapped here onto those forward-facing polygons which we don't want we want to have it mapped from the top so just select the material tag go down to the attributes manager and by using those coordinates here just flip it on the side so that the z-axis is facing onto the surface where you want your texture to be projected to so now we can see the first characters here appearing but as you can see here this texture plane is really really big so it's not working with the size of this model here so just to see what's happening here i'm gonna reduce the size at first to just 10 by 10 centimeters and now we can see our text appear here and we can also see that it's facing from left to right this is not what we want we want it to be facing this way so we have to turn it 90 degrees i'm going to use the hn angle here so i have 90 degrees h and minus 90 degrees p so this is working for now but now the size is not correct it's important that you have it in the middle of your object in this case for your case it might also be that you have to move it to the left and to the right or up or down you can use this position coordinates for this to position your decals but in my case since i've used the approach that i've just shown you with rendering out this image first everything is perfectly centered and should be working with the texture being placed here in the middle but it depends on your project but this question aside how would you determine how big your decal has to be which centimeter values do you have to enter here to get the right proportions well go back to your original texture that you made in photoshop you might have already asked yourself which size value you should have used in photoshop well this doesn't matter so much you of course should choose a value that is high enough so it looks good in your final rendering especially on close-ups but you can set this value yes so to speak however you want in my case it's 1920 by 3200 pixels and what's now very important is the word aspect ratio so for the moment i've just set this here to ten by ten centimeters which would be square but obviously two thousand one hundred and two thousand one thousand 1920 sorry by 3200 isn't a square image so you have to maintain this aspect ratio and i'm just gonna quickly explain this here for the ones who find this difficult to understand here on the left the orange square this is 1920 by 1080 image and so this has an aspect ratio of 1.77 if i divide 1 900 by 1000 so here the blue plane this has a width of 1200 and now to make it have the same aspect ratio i need to multiply this dimension here the 1200 by this value here by this aspect ratio or well in this case i have to divide it so i divide 1200 let's quickly do that here 1200 divided by 1.77 gives me 677 so this is this number here that's just not very accurate i should have divided it by 1.7777 because this is a periodical aspect ratio and so we get to the 675. so you always have to maintain this ratio to make it appear correct so if you're making this plane bigger here then of course you also have to change the y size in the same manner i hope this is clear so the left plane here this would be our original texture so here we have pixel values here on the left and on the right we want to have centimeter values so first of all we have to calculate the aspect ratio of the pixels and then use it with the centimeter values here on the right so going back to our actual project we had this texture here where we have 1920 by 3200 so i'm just gonna divide this i'm gonna divide 3200 by 1920 which gives me 1.66666 so now i can go to this texture here and if we have a look at the axis here you see this green y axis so that's the value we need to change for the width here so if i let's say increase the y value to 20 i make this texture appear wider so this has to be the long side of everything and how to get this value in the first place well we can just have a look at our model itself if we go here to the model mode again and if we select our polygon model here then we can see down here that it has a size of 31.2 centimeters so we have to divide this by two to get a reference value so we can just go to our material tag again go to the y value and enter the size of our models 31.2 divide this by two and then we get a rough estimate this won't work 100 unfortunately but we can get as i said a rough estimate to start with so now we have 15.6 centimeters for the long side and we've just calculated our aspect ratio of the original texture to be 1.66666 so the short side of our material projection here needs to be this length divided by 1.66666 so i'll just write 15.6 divided by 1.66666 and then i'll get 9.36 and what you can now do you can just try and play around with these settings here and use this or you can also try and play with the scale tool although i don't like to use it that much because sometimes i had problems with it but in this case i think it should work so you can just use this little triangle here to make it scale evenly along both axes and just get those final last percents of scaling that you need to change it but well now i've didn't want to do this i scaled my model this was of course wrong i have to use the texture mode here so now i have to use the blue triangle in my case and now we can see if this is going to work well this seems to work quite okay but i personally i'm not the biggest fan of this tool for materials but you get the point so not gonna bother you having to watch me trying to fiddle out the last percents here but i think you get the idea so you just have to play with those values probably you won't be able to maintain the perfect aspect ratio in a complicated case like this so you maybe just have to cheat a tiny bit but as long as you don't change up the values too much nobody will notice that that it's not the perfect original size like the texture that you've used so i think like this here it's already looking kind of right maybe needs a little bit tweaking to get it to the perfect size as long as you're all only using one or two decals or having like this the buttons that only have one single decal that can be centered in the middle then this will be very easy for you all right so let's have now a look at how to set up dry planar mapping in redshift alright so let's see how we can set up the tri-planar mapping in redshift i've got my old example scene back here but just with a little redshift dome light environment and that's it and we see our example object without any material so first of all i'm going to go to redshift materials and i'm just going to create a default redshift material and drop it onto my object it's not very visible because everything is gray we can change this by setting up another diffuse color here in my material so now we see okay this material seems to be active but we don't have any texture right now so i'm gonna change that i'm just gonna switch over to the other screen that you can see at the moment and i'm gonna drop in this material no i don't want to save it in the project folder i want to leave it where it is and now we have our texture here and we could now create this input here the diffuse color input for our redshift material and do this connection and we could see a change but this is not what we want because this is obviously not tri-planar mapping this is something else so i'm gonna just go here to the left and enter try planar in the search tab and now we just need to set the tri-planar between our material and our texture so just go to the output color of your texture and connect it to the input area here of the try planar node and then you'll get the little drop down menu and go to texture image x that's the one you want and now like with octane you can activate same image on each axis so you only need to set this up once for this single texture and now we have our output color here which we can connect to the diffuse color input of our redshift material and we can already see that it's looking a little bit better but still not the way we might want to have it so we go back to the triplanar mode and in contrast to octane we don't need another node here for the transformation we can just set this up inside of our tri planar and the other difference to octane is in octane you would reduce the number to reduce the scaling in redshift it's the other way around if you want to have smaller tiles you have to enter a bigger scaling factor here so if i set this from point zero one to just point one you can see the tiles are getting a lot smaller and i have my material set up here so in your case you would just have to play around with those settings to get the look that you want but overall the tri planner tends to make everything appear very big so you need small scaling values here as with octane you can also set another projection mode for example you can set this to world which we've already had a look at in octane so now the projection is locked to the world coordinate system and if i rotate my object here it looks like as if the texture would be projected with say a beamer on it and doesn't move at all you might use this for a little effect i don't know i've never used it in a project so i'll just stick with object so then the texture is bound to my object and will not move so this that's the tri-planar mapping for redshift you can of course also change the blend amount here and the blend curve this has to do with the edges just play around with those values to see how they can help you in the most cases i've never touched them but they control how the blending from one side to the other is happening so to sum this tutorial up we will now have a look at the cinema for the standard renderer and how to create our own triplanar setup there although the c4d standard error doesn't have it so we need to help ourselves okay so here we are now in the cinema 4d standard renderer so if i render this i don't see anything so i'll just activate the default light here under the render settings like as i said before this does not have to look very fancy it just has to work so you can understand the principles behind everything so as we don't have kind of an interactive render window as we are maybe used to have from redshift or octane we can use this preview region here interactive render region which is basically the same it's not that fancy it's just a little region that you can set up in your viewport here but it does the job so i'll just set this up so you can see what's happening so we will now create a new material drop it onto our object here and open up the material editor and now you can use the channel that you need i will just use the color channel here and go to the texture and set up a layer shader so now everything is black because we don't have anything here inside our layer shader but what i'm gonna create here is a new shader and use effects falloff and this falloff works with our objects coordinate system so if i click on this falloff i can see the space is object i can also set it to world or to camera as we already have seen for octane and redshift 2. so now we have set it to object and you can see the direction here this is a vector and the vector is x y and z so these are our objects axes so if i wanted to have this z axis here the blue one i would just enter 0 0 1 so now you can see that the top side got black that's because we have this gradient here and the the right end of the gradient is the positive direction and the left end is the negative direction so we have set up this vector here it says 0 0 1 which means positive one in that direction so this vector is pointing in the same direction as this blue arrow here so as i said the gradient goes from left to right and left means the negative values so this would be every polygon that is facing in the opposite direction of this vector here which is the reason why this top side of the object here got black so if we switch this for example it would become white so what we want now is that everything facing in the same direction gets white and everything that's facing in the different direction gets white too and everything in between shall be black so how can we do this we know left is negative direction right as positive direction and everything in between would be an angle so if you're well let's let me just set this up really quick we have this this cone here for example that's the vector that we just set up so now if i focus on this green arrow here this is facing in the same direction this would be positive this would be the right side of this gradient and now while i walk along this gradient so to speak this angle is changing and this arrow is turning so to say so 90 degrees would be the middle of this gradient this would be 50 and facing even more into the opposite direction of this cone of our vector would be the left end of the gradient so this would be zero percent i hope this made some sense to you so going back to our gradient here our fall of we know this means 180 degrees this means 90 degrees and this means zero degrees so we want it to be white at zero and at 180 degrees and everything in between shall be black so i'm just gonna set this up real quick i'll just leave a margin of around 15 on the left and on the right side and set up those stoppers here or those knots as they are called so now we see everything is black except the top side and bottom side so if i leave this camera here and look from the other side we can also see that these elements are white and we can see this edge here and everything beyond this edge is projected as black alright so now we can set up the same system again i'm gonna call this one fall of zed and i'm gonna right click on it go to copy shader and then i'm gonna click here on the shader button and go to paste shader and i'm gonna deactivate the visibility of this old falloff and i'm gonna call this new fall of fall of y just gonna click on it the gradient is already set up so i only have to change this vector here at the top so i'm gonna change it from 0 0 1 to 0 1 0 which would be the y-axis so we can check if this is working and this seems to work we see in green the y-axis arrow and the top is white and the bottom is white two and the rest is black so this is also working and now we can go to the shader button here and paste this one again also make only this shader visible everything else invisible go to the settings and again change this from 0 1 0 to 1 0 0 so only the x axis is now activated and we see only polygons facing in x direction both positive and negative are being displayed as white and everything else is black so now we have falloffs in every object direction and we can drop in textures so now i just have three textures here as you can see i have this art deco floor i have this fabric here and i have this uv test texture this checker board and the only thing i need to do now is just set them up to the axes i want them to be displayed on so this uv grid here will be displayed in x direction since it's on top of this fall of the fabric will be projected in y direction and so on and the last step to do is just go to the to this mode here and change it from normal to layer mask now do this for all the other ones too and i think this is not working all that well because i've not done the final step and the final step would be to click on this material tag go to the attributes and set it from uvw mapping of course this won't work we need to set it to cubic mapping so that's it and you can now see what's happening here i'm gonna get rid of this interactive render region and instead just use the regular render command and as you can see we have three different textures now this they don't look very good because especially they are very stretched out i can control this by the tiling here and the material tag so i'm going to just up the tiling here to say 8 in each direction so now this looks a lot better and i can see my uv grid being displayed in x direction my art deco floor in that direction and the fabric here in y direction so this is how you kind of fake dry planar in the cinema 4d standard renderer and the nice thing is because we are using this fall of here this layer with the smooth shading we have this soft transition at the edges so if i render this you can see here how it's blended together and if you wanted to have more control about this you can change this gradient here of course in comparison to octane and redshift this is a very elaborate process but it's still possible even in this little standard renderer here i hope this tutorial helped you the next one i'm gonna do is about unwrapping a hard surface model using the cinema for the uv tools so if you don't want to stick to try planar mapping and do the proper uv unwrapping and texturing then stay tuned for this next tutorial and i hope i'll see you then bye you
Info
Channel: ironscavenger
Views: 1,584
Rating: undefined out of 5
Keywords:
Id: h8sH0Oka_iU
Channel Id: undefined
Length: 39min 59sec (2399 seconds)
Published: Wed Feb 17 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.