I haven't watched the whole thing yet so I apologize if you explain in the video, but is it possible to get a plane to face the camera _only_ around the Z pivot, aka not up and down, only around?
@RVillani9 күн бұрын
@@bigmartin343 It is, but it's not explained in the video. You could, though, use the methods in this video to have the mesh follow vectors still computed from the camera, but modified to only rotate around Z. You can get the camera's X vector and normalize its X and Y components, removing Z, to have a normal that doesn't point up or down. Then 0,0,1 would be your Z vector. And Y, you can derive from X and Z by getting their cross product with Cross(X, Z). The order of the vectors in the cross product matters, so if Y looks flipped, try Cross(Z, X).
@user-rd3jf1uh1c23 күн бұрын
1:08:38 OMG! This is what I was looking for! But. What is "expantion" and "fuziness" params? how it work?
@RVillani23 күн бұрын
@@user-rd3jf1uh1c Fuzziness is the border blurriness. Expansion is to extend the mask towards its borders
@user-rd3jf1uh1c22 күн бұрын
@@RVillani If I have "sharp" color mask, (sharp mask need to get coord for textures), BUT may I "blur" border in this mask to make soft transition between textures?
@RVillani22 күн бұрын
@@user-rd3jf1uh1c if your masks are blurred in the texture, then you can use fuziness to blur the resulting masks from the shader too
@CarlosNorah26 күн бұрын
Thank you!!
@WinterOkkАй бұрын
Incredibly useful video!
@RVillaniАй бұрын
@@WinterOkk thank you!
@Three_WaysАй бұрын
Fantastic video
@arsen1156Ай бұрын
Good tutorial
@felixstief7830Ай бұрын
48:00 can i mix that with world align normal?
@RVillaniАй бұрын
Yeah, just make sure both normals (mesh's and WorldAlignedNormals) are in world or tangent space when you merge them with BlendAngleCorrectedNormals. And do the Division stuff before merging in the WorldAlignedNormals, otherwise you'd be affecting those too.
@HakiPalatinaАй бұрын
Thank you so much! I was trying to fix my healthbar problem and searched / tried stuff for 2 days, never found anything.
@RVillaniАй бұрын
Thanks for letting me know! I assume it's a plane with a healthbar material, then
@HakiPalatinaАй бұрын
@@RVillani It is a widget i spawn over the head of enemies in world space, not screen space, because i want the healthbars to partially disappear when they stand behind cover
@RVillaniАй бұрын
@@HakiPalatina Cool!! Glad I could help :D
@DLAfvr2 ай бұрын
You're awesome! This bug still hasn't been fixed in 2023, thank you very much!
@RVillani2 ай бұрын
Thanks! And... dammit Autodesk :/ It's as if they're happy as long as they have customers' money. Oh, wait..
@Shinjitsu_842 ай бұрын
@1:05 cant seem to do this hack any more in UE5 - its not allowing you to change the blend mode which is what actually lets you have a translucent glass shader versus an opaque pbr surface. The shading model does not seem to have any control over what kind of transparency you are allowed to combine, and there is not something that lets you specifically control the blend to something combined via the material functions. Is there any tutorial about how to do this with the same result in UE5 now?
@RVillani2 ай бұрын
Are you using Strata? I'm not familiar with it, but with it disabled, I can set shader models in the material in UE5. Also, even in UE4 you couldn't mix translucent and opaque models in the same material. You need separate sections in your mesh with separate materials for that, as I show at 1:01:35. I think you can only mix opaque shader models, like Default Lit and Subsurface. As for the blend, I also show it in the video, with material functions. Without material functions, you still have to create material attributes to blend them with BlendMaterialAttributes (1:02:01). To create material attributes, you can do like I did in the material function, at 1:02:15, with the MakeMaterialAttributes node or SetMaterialAttributes. Then you set the different shader models in each Material Attributes and blend them with BlendMaterialAttributes.
@Shinjitsu_842 ай бұрын
@@RVillani No no strata. Using the exact same setups demonstrated here just in unreal 5 the blend mode is not something you can change by the shader model. Looks like you could do it in 4 but not 5. Masked or translucency is not something you can change it seems even if wrapped in a material function and blended using the node you mention and show in the vid. We only get access to a preview blend mode and it makes you choose one or the other once the blend.
@Shinjitsu_842 ай бұрын
@@RVillani ah wait got it now lil bit different for unreal 5 you have to declare the final render parent materials blend mode to be translucent mode no matter what. Then of course set its lighting mode to surface forward shading to get the default pbr properties back.
@MantoDev2 ай бұрын
Meu jovem, sou eu de novo kkkk Sera que vc num pode me dar um help num sistema que eu to fazendo? Eu to usando o conceito que vc explicou aqui, e funciona lindamente make rotation se eu rotacionar no eixo X e no Z, se eu aplico o mesmo conceito no eixo Y, a rotacao acompanha ate metade e depois inverte. Pode me dar um help com isso? Por email, whatsapp, discord, sei la kk Abs
@RVillani2 ай бұрын
Se nao me engano, se vc usa só o Y, ele tenta sempre apontar o Z pra cima. Se vc quiser controlar, precisa usar o Make Rot from YZ e dar um Z válido pra ele, que mude quando a rotação chegar nos 90 graus onde inverte. Outro esquema é usar o YZ quando não tá perto dos 90 graus, e trocar pra YX ou mudar o Z quando estiver perto dos 90 graus. Meu usuário do discord é o mesmo do meu canal aqui.
@MantoDev2 ай бұрын
@@RVillani Eu te adicionei la. Eu acho kkk Nao manjo de Discord Eu tentei usar YX e YZ, mas nao rolou. Eu ja adicionei um monte de print string pra tentar entender o que ta rolando mas num ta rolando :/
@henriviolin2 ай бұрын
The fact you're straight to the point is much appreciated, Rodrigo. Also, the intro you created (1:04) always blows my mind lol. Very helpful and inspiring content. Keep up the good work!
@RVillani2 ай бұрын
Thank you so much, Sir! ❤❤
@DirkTeucher2 ай бұрын
That was impressive. Thank you.
@lordkelvin12 ай бұрын
amazing thank you so much. Really handy
@BrunoS_Silva2 ай бұрын
"Press pee on your keyboard"
@RVillani2 ай бұрын
then Pee again, so PP :P
@t3hpwninat0r2 ай бұрын
when you get lllllllllllll.lllllllllllll because of divide by zero, that's because any number divided by zero equals infinity and you don't have enough ram to fit infinity. the solution: download more ram
@RVillani2 ай бұрын
lol
@RVillani2 ай бұрын
next tutorial: how to download more ram
@UltimateMusicMixStation2 ай бұрын
Wow!, I really have learn a lot of things I didnt know about materials. Thanks for this content! 🙂
@JamesNyeVRGuy2 ай бұрын
About to watch an hour and a half banger of a tutorial
@RVillani2 ай бұрын
Thanks, my friend! Let me know what you think
@sreedhar72663 ай бұрын
Can anyone helpme understand the theory on how to mix plane values? Thank you
@RVillani3 ай бұрын
That's what the video is about, so I need you to be more specific so I don't just repeat what's in it. What questions do you still have left after watching it?
@sreedhar72663 ай бұрын
Sorry, I just can't understand the math you explained at 5:06 I really love the video thanks for sharing, So you took pixels of different colors i.e RGB values and you multiplied them with the vector in those directions.you get three more values and then you added the x values of all 3 coordinates I really can't get my head around this , like why we should multiply that and add that,, sorry I think my math is very poor :(
@RVillani3 ай бұрын
@@sreedhar7266 haha no worries. The only thing you have to feel bad for is making me listen to my terrible English from back then (not that it has improved much lol). For each pixel, we want a final color that's the combination of all 3 planes. Each plane represents an axis: X Y and Z. But you need to know how much to use from each of those planes proportional to the intensity of each axis in a pixel's normal. If a normal is [1, 0, 0], you want 100% the X plane, and nothing from the other 2 planes. If a normal is [0.8, -0.3, 0.1], you want 67% of X, 25% of Y and 8% from Z (I'm rounding to make it easier). The total combination of all planes must always be 100%. If it's less, you're making a darker color, and if it's more, you're making it brighter. To figure out how much of each plane you need to have a combination that sums 100%, you calculate how much each axis of the pixel's normal represent from their total value. To do that, you divide each one by their absolute total. Absolute means you always get their values as positive. Starting from my [1, 0, 0] example. If you sum 1+0+0, total is 1. Then, if you divide each individual axis by the total, 1/1 is 1 (100%), so we'll use 100% of the color from the X plane for that pixel. The other two will be 0/1 = 0, so we'll use nothing of the Y and Z planes for that pixel. Now, for [0.8, -0.3, 0.1]. Sum is 0.8+0.3+0.1, total is 1.2. Remember we ignore the negative sign. Now, divide each axis by the total to find out how much they represent of it, up to 100%. X is 0.8/1.2 = 0.66666 (67% rounding up), so we get the color from plane X and multiply by 0.66666. Then, Y is 0.3/1.2 = 0.25 (again, ignore the sign), so get the color from Y plane and multiply by 0.25 (25%). Finally, Z is 0.1/1.2 = 0.083333 (8% rounding down), so we multiply the color from the Z plane by 0.0833333. Now, let's say all projection planes had white (1,1,1) at this pixel. If we multiply each of those white colors by the values from any one of these examples and add them together to make the final mixed value, they'd result in (1,1,1), because we made it so each of the axis of the normal represents a part of a total of 100%. For a more colorful example, that's probably better to visualize it in the mind, let's say plane X gave us magenta (1, 0, 1), plane Y gave us yellow (1, 1, 0) and plane Z gave us cyan (0, 1, 1) for a given pixel. And let's use our second example normal to compute the combination of the 3 planes, [0.8, -0.3, 0.1]. From the math in that example, we know we want 0.6666 of the X plane, so we multiply its color by that value -> (1, 0, 1) * 0.66666 = (0.6666, 0, 0.66666). Then, Y is (1, 1, 0) * 0.25 = (0.25, 0.25, 0). And Z is (0, 1, 1) * 0.083333 = (0, 0.083333, 0.083333). When we add those resulting colors together, we get the total of each channel = (0.916666, 0.333333, 0.749999), which is a pinkish color, because X was magenta and it was the most pronounced axis for the example pixel normal. Also, even adding those 3 colors together, that could easily add up to more than 1, we never got values greater than 1, because this math uses each color proportional to a slice of the 100% combination of the axis values. Does that make sense?
@sreedhar72663 ай бұрын
@@RVillaniOh my god!! Thank you so much man! Now its all clear. Neat explanation. You are amazing man!
@OriginRow3 ай бұрын
Any better solution for Neo Kinect product to make Vtubing mocap smoother !?!
@RVillani3 ай бұрын
Are you Lerping the transforms already? What's Vtubing?!?
@OriginRow3 ай бұрын
@@RVillani I mean like VR rig. VR rigs are smooth and almost zero glitches b/w bones. With kinect sometimes the bones are twisting right. Does control rig a viable solution ? Most of VR/Mocap for UE on YT making Control Rigs. How can I overcome with this problem ? Any suggestions would be helpful. Thank you in advance. Anyway I am not Pro in Skeletal meshes or rigs.
@RVillani3 ай бұрын
@@OriginRow These are not simple issues, unfortunately. I advise you to get help from a technical artist. Lerping the transforms from frame to frame is one of the easiest ways to smooth the jittering out. Twisting of the hands is something Kinect always does, unfortunately. For that, I'd recommend getting the correct hand orientations from the VR controllers.
@samstersos3 ай бұрын
Hey, so I followed the tutorial and it works perfectly within the viewport but for whatever reason when I press play it stops working. Do you have any ideas what could be causing that? Thanks for the great tutorial!
@RVillani3 ай бұрын
thanks! Could be many things. The objects in play mode could be having stencil or custom depth disabled, for some reason. Or your player camera is overriding post process settings and disabling the PP material. Or something attached to the camera is drawing custom depth covering all the custom depth in the scene. Or you were testing from inside a Post Process Volume that's not set to infinite bounds, but in play you're outside of it. Or in your material you set some parameter during play that disables the effect. Or even something else specific to your project that I'd never guess haha You'll have to debug. While playing in the editor viewport, you can press F8 to eject from your player into level-editing mode. Then you can select things in the viewport or in the World Outliner and inspect their details to see if the expected depth/stencil settings are set on the meshes. You can also select your pawn/character and inspect its camera to see if it's overriding any post process settings. While ejected, you can also change the viewport mode from Lit to other view modes and see if stencil and custom depth look as expected. To go back into possessing the character, press F8 again.
@ddvictor3 ай бұрын
Meu irmao, muito bom. valeu! Eu tenho uma pergunta: Quando tento usar esses sistemas em projetos de VR, tipo look at rotation, onde eu coloco um objeto para rotacionar mirando no controle, quando o angulo eh menor que -90 ou maior que 90, o objeto seguindo a mao inverte e passa a girar na direcao oposta se usarmos o resultado de um eixo so tipo uma porta girando so no eixo Z, mas isso nao acontece quando estamos usando todos os 3 eixos como no seu exemplo. Pq? D:
@RVillani3 ай бұрын
Vlw! XYZ são 3 eixos sempre perpendiculares um ao outro. Se um gira, afeta os outros 2. Quando vc usa um eixo só, a Unreal precisa escolher um segundo eixo pra completar a rotação, senão os outros 2 eixos rodariam aleatoriamente. E esse segundo eixo sempre vai apontar pro mesmo eixo no mundo. Por ex, se vc falar pra Unreal apontar o X pra qqer lugar, ela vai tentar manter o Z do objeto pra cima, q é o Z do mundo. E o Y vai ser perpendicular ao que resultar dos outros dois. Mas se vc apontar o X pra cima ou pra baixo, em 90 ou - 90 o X tá apontando pro Z do mundo, e o Z do objeto tá deitado. Então quando virar 90.0001, o Z ficaria pra baixo. Mas como ele é sempre direcionado pra cima, o objeto dá um 180. O esquema é semprr usar 2 eixos. Senão a Unreal sempre vai escolher o segundo por vc e tentar apontar ele pra um ponto fixo.
@RVillani3 ай бұрын
3:15 tem um exemplo com o X e Unreal fazendo o Z ficar pra cima
@ddvictor3 ай бұрын
@@RVillani cara obrigado pelo retorno. Mas eu repliquei os seus exemplos e continuo nao entendendo o pq que meu teste nao funciona. Sera que vc nao podia me dar uma forca com isso no privado? Eu nao encontro nada em lugar nenhum sobre isso, todos os exemplos que eu vejo pessoas usando vetores sao iguais com excessao ao seu. lol
@ddvictor3 ай бұрын
Eu consegui reproduzir o mesmo efeito! 🙌🙌🙌🙌🙌🙌🙌🙌🙌🙌 Mas ainda estou tentando entender o pq que funciona kkkkk Cara obrigado pelo video, eh esclarecedor ainda que eu nao tenha entendido 100% a hora que der o estalo eu vou dominar essa p* hahahaha Valeu
@RVillani3 ай бұрын
@@ddvictor Tem coisa que pra mim foi assim tbm. Tive que tentar, dormir, tentar, dormir... Até o Tico e Teco clicar e entender o q tá acontecendo haha
@robertturaa95613 ай бұрын
I knew about this. I came across this video because 3ds Max still doesn't export Morpher sometimes *sigh*, even if it's the only modifier on the stack.
@RVillani3 ай бұрын
:/ that sucks
@robertturaa95613 ай бұрын
@@RVillani I found a solution on a forum. You can copy the modifier, delete it and then paste it back just before exporting :D. Clearly a bug >_>. It worked for me. I spent almost a day on this. Leaving it for future generations as knowing Autodesk it will never get fixed.
@RVillani3 ай бұрын
@@robertturaa9561 this video is 7yo and people still thank me for it. So, indeed, never 😕
@hassanb.eclipseHassan3 ай бұрын
Instead of screen mapping, can we lock the projection to the camera's viewpoint?
@RVillani3 ай бұрын
But that is screen mapping. The screen is the camera viewpoint. What are you looking to achieve, exactly?
@hassanb.eclipseHassan3 ай бұрын
@@RVillani I'm looking into using the camera as a projector to display AI-generated images of a 3D environment based on scene z-depth. The idea is to project these images back into the scene using the same camera used for rendering. I came across a technique similar to this in a Blender tutorial here. thanks!
@RVillani3 ай бұрын
@@hassanb.eclipseHassan so you mean projecting the texture from a specific point and direction in the world (the camera that did the rendering) and see that projection from a separate viewpoint (i.e. the player camera view)? If so, I think UE has a texture projection node, but I don't remember the name. It's something weird like ZAlignTexture. I used it once to fake caustics projection at the bottom of a pool, 6 years ago. Wasn't intuitive. I'll see if I can find out more, but in the mean time check out material nodes with Texture, Project, Align or Z in their name.
@hassanb.eclipseHassan3 ай бұрын
Instead of screen mapping, can we lock the projection to the camera's viewpoint?
@teher1k4 ай бұрын
Finally a video that shows me how to solve my text issue with rotated BPs. Thank you very much!
@ArsBeneVivendi4 ай бұрын
Pure GOLD, than you Sir for sharing all these tips,so many PERFORMANCE WISE ideas, just wow
@RVillani3 ай бұрын
Thank YOU for the kind words! :)
@LauriKalliola4 ай бұрын
Thank you for the awesome tutorial and in-depth teaching! I have a question on using a similar material: In the editor viewport view the occlusion outlines are drawn as intended, which is only when an object is behind something, for example a wall. But in the play mode and camera view the outlines are drawn on meshes even when there is nothing between the camera and for example the player mesh. Any ideas on how to fix this or what settings to look at? Thank you!
@LauriKalliola4 ай бұрын
Hmm, the problem was fixed when I swapped from using the normal "Camera" component to using "CineCamera" component. The normal camera probably has some rendering/post process settings which caused my issues.
@piingy4894 ай бұрын
This tutorial is great! You explain so well!! I have a question regarding the time stamp 29:12 - how can I do so that I it will only render the lines on the objects that are not behind any other scene object?
@piingy4894 ай бұрын
I finally got my nodes right, so what i did was: Custom depth - Scene Depth, then put that into ceil and then clamp bethween 0 to 1. Then I masked R and then did a "oneminus". This then got put into the multiply node that was put into the lerp alpha :)
@RVillani4 ай бұрын
Nice one! Sorry I didn't answer before. I think I missed the comment notification :( There were some people who asked something similar, I think. But KZfaq's comment ordering is weird, so it's a bit hard to find it. Thank you for the compliment on your first comment as well! 🫶🏻
@NJoint4 ай бұрын
Man, this is the best tutorial I've watched in a long while. It wasn't just some mindless button-pushing. You made me understand what I was doing. Thanks a lot
@RVillani4 ай бұрын
Thank you for letting me know! 🫶 I really strive to teach the why, not just the how. That way you can get this new knowledge and apply it to a different problem.
@NJoint4 ай бұрын
@@RVillani you nailed it with this one. I shared it to a couple of colleagues. I really hope you can afford to do this more often
@RVillani4 ай бұрын
@@NJoint Thank you for the kind words! I hope so too. I was very frustrated with my latest videos. The audio was bad (don't know how I didn't notice that while editing) and I feel like I'm not explaining things in a clear manner. Because of that I've been holding off on making more content until I figure out why I became so terrible at explaining this stuff.
@Mr_Dee4 ай бұрын
Saved my evening:)
@RVillani4 ай бұрын
thanks for letting me know 🫶
@Mr_Dee4 ай бұрын
@@RVillani I now have a realtime shadowcatcher in UE5.4 with Motion Design. No more Composure plugin😜
@RVillani4 ай бұрын
What do you mean with shadow catcher? Like something that receives 3D shadows but on top of a video/image background?
@Mr_Dee4 ай бұрын
@@RVillani exactly that!
@RVillani4 ай бұрын
@@Mr_Dee that's cool! So I guess you used the screen mapping stuff
@TheNJ934874 ай бұрын
What the?
@TheNJ934874 ай бұрын
Nice art spulting 3d. 🤘🏾🤘🏾
@heberryan14075 ай бұрын
Super Useful! Thanks for making such a good video to explain it!
@YuvalDorfman5 ай бұрын
O my god!!!!!! i was stuck on this for an hour and kick broke my Office door from frustration!!!!!! THANK YOU!!!!!!!
@dhruvrattan5 ай бұрын
Can you please Help me make this, I am really need this for an unreal project
@RVillani5 ай бұрын
I used instanced static meshes with a material that rotated them to always face the camera in a specific way. But now I'd just make it in Niagara. It would be much easier.
@PinkTommie5 ай бұрын
its 2024 and this bug still exists in max 2023
@Flowerpot29056 ай бұрын
Brilliantly explained - Thank you.
@lorryburger81656 ай бұрын
Thank you for this!
@n1lknarf6 ай бұрын
if you see an obvious problem during the tutorial and then don't fix it because "once you understand how it works it's very simple", then what was the point of watching the tutorial? No one watching it understands how it works :/
@Eduardfp6 ай бұрын
Hey Rodrigo! Really struggling with your setup. Could you share the settings that you are using? If I create a cube with a mirror material and all the other settings that you have, the cube is very glitchy specially in the corners.
@RVillani6 ай бұрын
I set this up back in UE4. I have never tried it on UE5, but with the new Lumen settings, I bet there's more options that need changing. Like Lumen's raytracing quality, reflections count and whatnot. I'm not sure all the required options are there now, but you could try playing with them in the Lumen's section of the post process settings. Honestly, I'm not even certain this can be achieved in real-time anymore with Lumen. Perhaps only on the path tracer now.
@Eduardfp6 ай бұрын
@@RVillani Oh, yeah, I even tried with UE 4.27.2 because of this reason, but I could not manage to do it. The corners of the cube reflect what is inside but stretches all the reflections. Not sure what it is, I think it could be the path tracing?
@MortMort6 ай бұрын
When i change the UV cordinends of the Custom Depth and add them togeter It dosn't mask it out, but if I dont offset the Scene texture custom depth texture it dose mask it out, why dose it not work as soon as I offset the UV's and add them togeter?
@RVillani6 ай бұрын
Maybe the offset values are miscalculated somehow? Could be many things. I advice you preview each node in your sequence of nodes to see if they display expected results. If you need to see specific numbers, you can use the debug nodes and preview them (Debug Scalar, Debug Float2 and so on). That way you debug where things are going wrong in the logic and find what needs fixing.
@jcdentonunatco7 ай бұрын
this was super helpful, thanks!
@nick91377 ай бұрын
If anybody wants to be able to selectively occlude (for example lets say you have a pickup coin and your character, you don't want the outline on your character when behind the coin) you can do the following: do everything in the video except ALSO add an IF node, and we will use a stencil value of 2 as an object we don't want to occlude, (our coin will be 2, our character will be 1), you can do an if and if the stencil value is = 2 then instead of rendering out whats in the video you want to render out just the post processing input with mask of RGB, hope this helps
@RVillani7 ай бұрын
If you were asking how to do that, that's pretty much what I'd have suggested. A stencil value for "ignore this". I don't think there's another way if you can't tell those objects apart. Thanks for that comment!
@ufukardc71697 ай бұрын
And I was wondering why my code isn't working, thanks!
@mavreon7 ай бұрын
Thank you so much for talking about this, please can you make a video on the AttachMeshToTheCamera node?
@RVillani7 ай бұрын
I think so. But I need to reconfigure my setup for recording. I had to format my PC recently and haven't set that up again yet :/
@chinanumberone7 ай бұрын
Great video, ty very much!
@syedahmedshah32149 ай бұрын
Can you please help me with the settings you have done, Because i have followed all along but didn't get the results, Please if you would help me to do the settings and which version of engine you're using?
@RVillani9 ай бұрын
That was back in UE4, before Lumen. I'm not sure that's possible with Lumen as I haven't tried. I hope it is! But it will definitely require all the heaviest hardware raytracing settings, if it can do that.
@syedahmedshah32149 ай бұрын
No i was using with Ray Tracing no Lumin, Well i will try to create this in UE4. Many Thanks 😊