Vertex Lighting - Custom Lighting Models - Episode 2

Поділитися
Вставка
  • Опубліковано 30 січ 2025

КОМЕНТАРІ • 45

  • @MarcoLanzillotti-ps2kv
    @MarcoLanzillotti-ps2kv 7 днів тому +6

    @bencloward you are a gift from heaven

  • @alyson_lupo
    @alyson_lupo 7 днів тому +7

    Thank you sir, for sharing your amazing knowledge

  • @Druelbozo
    @Druelbozo 7 днів тому +4

    Its so nice to get such an awesome video on the topic that I'm researching right when I start. Thank you so much!

  • @maxgordon3194
    @maxgordon3194 7 днів тому +3

    thank you ben. can't wait for the next video.

  • @procrastinator24
    @procrastinator24 6 днів тому

    Can't wait to start all of your shader tutorials after I'm through with all my general unreal courses, you're awesome!

  • @ErikBorchersVR
    @ErikBorchersVR 7 днів тому +1

    I love your channel Ben! Thank you for sharing your knowledge.

  • @mohammadvasegh1754
    @mohammadvasegh1754 7 днів тому +1

    Thank you Ben

  • @Wishbone_Games
    @Wishbone_Games 7 днів тому +3

    I love these videos

  • @ReiterEmanuel
    @ReiterEmanuel 7 днів тому

    Very good video Ben!
    It would be really cool to see in the future an implementation of an anisotropic shader.

  • @elpainto1
    @elpainto1 7 днів тому +1

    Great demo! I've used vertex lighting on some projects to help optimize rendering before, so I'm glad to see it's still something that would be seriously considered. At some point will you cover how to get more lighting data from the lights? In shader graph I'm not seeing how to get the light color or attenuation, which is pretty important.

    • @BenCloward
      @BenCloward  7 днів тому +4

      Yes, I’ll show how to get the extra light information in a future video.

  • @mohammadvasegh1754
    @mohammadvasegh1754 6 днів тому

    Hey, I can add a detail if I may, You calculated the ambient lighting using the Lerp formula while implementing the shader in Unity. I think you could also use the BakedGI node. it calculates the ambient lighting automatically and also can give you access to the lightmap information if you need to also bake the light on vertices.

    • @mohammadvasegh1754
      @mohammadvasegh1754 6 днів тому

      oops, the lightmap data breaks if you bake the lights and use the vertex shader calculations.

    • @BenCloward
      @BenCloward  5 днів тому

      Yes, absolutely - you're right. Currently, we're building a version of the shader that is as cheap as it can possibly be. For that reason, I'm going with flat colors for ambient. In later videos, I'll get to more advanced techniques.

  • @unnmmd
    @unnmmd 7 днів тому

    I think it's a good idea to multiply an AO map with an inverted dot product node, because ambient shadows usually disappear when lit by any light source.

    • @BenCloward
      @BenCloward  7 днів тому

      I get what you're saying and it's true, but that's a little bit more advanced than what I'm showing here. If I had done it better, I would have combined the AO and diffuse textures in Photoshop so I was only sampling one texture instead of two - because that's how it was done way back then. And then as an improvement - if I had the texture memory to spare and the pixel shader performance, I could do what you're describing and make it so the AO mask only effects the ambient and not the diffuse.

  • @IbtesamSadiq
    @IbtesamSadiq 7 днів тому

    I am curious if you will cover scenarios like occluded sunlight. for example if we put a sphere in room where sunlight is coming in through window which has bars and hit the sphere. in this case there will be a sunlight and window's bar shadow casting on sphere. this is just one example but is there any way to get dynamic light occlusion data or scene lighting similar to Editor-View modes (Simple Lighting and detailed lighting.)

    • @BenCloward
      @BenCloward  7 днів тому

      I will show how to access light occlusion (shadow) data in a future video, yes. However, this is one of the items that I only know how to do in Unity and not in Unreal.

    • @IbtesamSadiq
      @IbtesamSadiq 7 днів тому

      @BenCloward unfortunately I left unity in 2019, and now I work with unreal engine only. Based on what I found, it's not possible in unreal without touching the source code.

    • @BenCloward
      @BenCloward  7 днів тому

      @@IbtesamSadiq Yep, I believe that. Unreal seems to be a bit more closed off when it comes to customization.

  • @AlekMadeDis
    @AlekMadeDis 7 днів тому +1

    Hypothetically speaking, given the relatively high vertex count in our assets, the artifacts might not be as noticeable, right? Meaning, implementing specular lighting could result in quite appealing shading for the LODs overall. I’ve seen something similar being done in Batman: Arkham Knight.

    • @BenCloward
      @BenCloward  7 днів тому +4

      It totally depends on how much artifacting you're willing to put up with. I'll show what specular looks like in the vertex shader next week when we cover specular.

  • @FireF1y644
    @FireF1y644 7 днів тому +3

    33:58 - You can also press *C* to create a comment. Thanks for the video

  • @bobsmith4223
    @bobsmith4223 3 дні тому

    Awesome! Question: Isn't Minecraft using vertex lighting as well but passing the closest light sources ? Is there a way to pass this king of data to this shader to achieve the same voxel lighting result? Thanks!

  • @meloin522
    @meloin522 6 годин тому

    I noticed that SkyAtmosphereLightDirection node doesnt work with instanced stereo rendering for VR(actually works only for one eye).
    Do you know some other way to get this vector e.g. for Directional light ?

  • @ZeHatsu
    @ZeHatsu 6 днів тому

    While I know this specific technique is long obsolete it may be useful to cover embossing/the old way of faking bump mapping (I already know how it works and how to implement it but having this technique get more exposure could potentially be useful for someone)

  • @ovrava
    @ovrava 7 днів тому

    Love your videos. Are your Videos made in a way that one can skip the unity Part without losing anything? Or do I have to go through them as well?

    • @BenCloward
      @BenCloward  7 днів тому +2

      You can usually skip the part you don't need. Occasionally I put something in one part or the other that's unique, but it's not intentional.

  • @omri1324
    @omri1324 3 дні тому

    question- instead of multiplying by 0.5 and adding 0.5. why not saturate the masked vertex normals?

    • @BenCloward
      @BenCloward  3 дні тому +1

      The Y component (in Unity) of the vertex Normal has a range from -1 (pointing down) to 1 (pointing up). If I were to saturate that, as you suggest, I would get 0 at the bottom, 0 in the middle, and 1 at the top. So my blend would only go from 0 to 1 from the middle to the top. From the middle to the bottom, it would all be 0. But I want it to blend from 0 to 1 from the bottom to the top, so I have to adjust the original range to go from 0 to 1 instead of -1 to 1. And I do that with the * 0.5 + 0.5. I hope that helps.

    • @omri1324
      @omri1324 5 годин тому

      @@BenCloward Yep! thanks for the reply!

  • @Hpalhazred
    @Hpalhazred 7 днів тому

    OMG you really did it 🥳, thank you. Is it working with Unreal 4.27? I'll check the video tomorrow 😁

    • @BenCloward
      @BenCloward  7 днів тому +1

      It should, yes. There's nothing here that's engine specific. I don't know if the light direction node exists in that version. If not, you can just substitute a Float3 node and hard-code it.

    • @meloin522
      @meloin522 День тому +1

      Yeah, node exist in 4.27

  • @johnrossporter3439
    @johnrossporter3439 7 днів тому +1

    How would I add support for more than 1 light?

    • @BenCloward
      @BenCloward  7 днів тому +4

      We’ll get to that in a future video. I’ll warn you now, though, it’s pretty complicated.

  • @ijerofei
    @ijerofei 7 днів тому +1

    Is it possible to make vertex lighting with shadows somehow?

    • @BenCloward
      @BenCloward  7 днів тому +7

      The lighting can be done in the vertex shader, but shadows need to be done in the pixel shader. You could do them in the vertex shader I suppose, but the result would look awful because there wouldn't be enough vertices to get the detail you need. It's similar to specular. I'll show how to do shadows in a future episode.

    • @ijerofei
      @ijerofei 7 днів тому +1

      @@BenCloward thank you very much!

  • @judewilson927
    @judewilson927 7 днів тому

    Anyone else get an error from the Light Direction node once its passed through the Vertex Interpolator node using UE4.26? Not using UE5 due to developing for Meta Quest.

    • @meloin522
      @meloin522 День тому

      in 4.27 it works, dont know about 4.26

  • @monado1761
    @monado1761 6 днів тому

    Why did we use add node then saturate to vertex ws node and just use saturate again to vertex ws

    • @Frangoh22
      @Frangoh22 3 дні тому

      These two operations affect the range of the original value slightly differently.
      When you add 1, the -1 to 1 range becomes 0 to 2, you then saturate it and throw away all values above 1.
      While when you just saturate, you are changing the -1 to 1 range to 0 to 1 right away by throwing away all values between -1 and 0. So the resulting masks that you use as the T input of the lerp are different.

  • @annaellmechavant4344
    @annaellmechavant4344 6 днів тому

    Oh this is awesome, I was just about to experiment with Gouraud shading, thank you so much for starting this series! I have two questions:
    -Do you know a good way to replicate the "toonify" effect used in the wind waker, showcased in this video? ua-cam.com/video/mnxs6CR6Zrk/v-deo.html
    My approach would be to have the palette as a 255x1 texture parameter that would be set depending of the day/weather and sample it using the with the dot product result (the saturate(ndotl)).
    -In older games vertex colors seem to be used instead of baking the lighting in the diffuse map, where would the multiplication of the vcolor happen in the shader your showcased? Just after the saturate(ndotl)?
    Thanks again for this series, this is extremely helpful for people like me trying to replicate the older games' lighting! :)