React Three Fiber & Three.js - Lights Explained

แชร์
ฝัง
  • เผยแพร่เมื่อ 5 มิ.ย. 2022
  • Hi there 🙋‍♂️
    In this video you'll learn how to implement all the available lights in three.js using react three fiber! This will get you started and allow you to use the lights in your own scene. There is, however, much more to tell about lights, so stay tuned for that or check out the original three.js documentation already! 🎉
    --
    This channel is meant to help you start developing 3D websites. The videos are meant to be short and educational. Make sure to subscribe in case you want to learn more about developing 3D websites!
    ---
    🔗 LINKS MENTIONED IN THE VIDEO
    3️⃣ Starting code: github.com/sjoerdvanBommel/th...
    3️⃣ Final code of this video: github.com/sjoerdvanBommel/th...
    ---
    🔗 OTHER VIDEOS
    3️⃣ React Three Fiber & Three.js - Materials Explained 🔮: • React Three Fiber & Th...
    3️⃣ Learn to debug your UI real time using LEVA: • Learn to debug your UI...
    3️⃣ React Three Fiber & Three.js - Textures Explained: • React Three Fiber & Th...
    ---
    📫 CONTACT ME
    3️⃣ GitHub: github.com/sjoerdvanBommel
    3️⃣ Instagram: / threeveloper
    3️⃣ Twitter: / threeveloper
    3️⃣ LinkedIn: / sjoerd-van-bommel-8a23...
    3️⃣ Discord: Threeveloper#6584
    ---
    ⏲ TIMESTAMPS
    0:19 Introduction
    2:05 AmbientLight Explained
    2:41 HemisphereLight Explained
    3:03 DirectionalLight Explained
    4:26 PointLight Explained
    4:50 SpotLight Explained
    6:28 RectAreaLight Explained
    ---
    Music by Coma-Media: shorturl.at/tyCEF
    ❌ DON'T CLICK HERE
    shorturl.at/mqtCR
    Got you there ;)
    #threejs #webgl #reactthreefiber #3d #webdevelopment #frontend #javascript

ความคิดเห็น • 34

  • @BTjacker
    @BTjacker 9 หลายเดือนก่อน +1

    Very useful videos! Thx for your work❤

  • @SheriffKoder9
    @SheriffKoder9 4 หลายเดือนก่อน +2

    Very well explained thanks a lot ! now i can use this tool to debug my lights

  • @drgregoryhouse1470
    @drgregoryhouse1470 9 หลายเดือนก่อน +2

    Nice content, but i think you should crank up your voice volume a bit and lower the music so you're more understandable

    • @threeveloper
      @threeveloper  9 หลายเดือนก่อน

      Thanks for the tip, hopefully my newer videos have better audio quality 😄

  • @trungtrung2248
    @trungtrung2248 2 ปีที่แล้ว +2

    Thank you, it's so helpful for me

    • @threeveloper
      @threeveloper  2 ปีที่แล้ว +1

      Great to hear that 🙌

    • @trungtrung2248
      @trungtrung2248 2 ปีที่แล้ว +1

      @@threeveloper can you make video about content: how to import 3d animation model like a character is kicking

    • @threeveloper
      @threeveloper  2 ปีที่แล้ว

      Yes, will add it to the list! But have some other videos planned as well 😉

  • @xavierdoesntmatter
    @xavierdoesntmatter 11 หลายเดือนก่อน +1

    One thing that brought me to your video that was missed sadly is the fact that when you import models from blender that have metallic surfaces that they do not get lighting effects from most lights. I know Hemisphere, Ambient and Directional do not light them up, need to try the point light now i guess.

    • @threeveloper
      @threeveloper  11 หลายเดือนก่อน

      Thanks for pointing that out! :) You might want to check the type of the material that gets generated from the metallic surface in blender, so based on that you can know what lights reflect on it

    • @xavierdoesntmatter
      @xavierdoesntmatter 11 หลายเดือนก่อน +1

      @@threeveloper I finally solved my issue by using drei. The Environment option to add lights seems to always affect metallic surfaces from blender. I was trying to do an ambient lighting effect and this was the only route I could figure out that was lighting from all directions that would work on metallic. I'm not sure how performant it is though.

  • @Luvnitsawhney
    @Luvnitsawhney ปีที่แล้ว +1

    Hey great video, I wanted to know if I can add three rect lights in a scene and then change the X and Y axis of the lights ?
    So basically I want to light a product in a virtual setting and have 3 rect lights one on the top, one on the right and one on the left. and then change the X and Y locations of the lights and not the light emitting source area. Would love some help.

    • @threeveloper
      @threeveloper  ปีที่แล้ว

      Hey Luvnit! Nice that you're reaching out. I'm not fully understanding the difference you mean between the "lights" and the "light emitting source area". But you can move lights by setting a ref to the rect light and changing its position in a useEffect. Or do you mean something else? :)

  • @timetosleep8055
    @timetosleep8055 ปีที่แล้ว +1

    Hey, How would I add a helper for a shadow camera? In vanilla threejs it's very easy:
    const spotLightShadowHelper = new THREE.CameraHelper(spotlight.shadow.camera);
    scene.add(spotLightShadowHelper );
    But I don't know how to do this in R3F, tried using same method as addding helpers for lights. (Baking shadows would be better, but still would like to know how to do this xD. Maybe this could be a video on its own.

    • @threeveloper
      @threeveloper  ปีที่แล้ว

      That indeed sounds like a video idea 😄 But until then: more people ran into this issue. You should give this custom hook that I linked below a try, which accepts a ref to a light :) Let me know if that worked out for you!
      stackoverflow.com/a/69424854

  • @ahmedsyed671
    @ahmedsyed671 2 ปีที่แล้ว

    Can you do a video about camera and how to animate them ? thx

    • @threeveloper
      @threeveloper  2 ปีที่แล้ว

      Hey Ahmed! I already created a video about camera's 😉 You might find that one useful: th-cam.com/video/Isr-hIveUK0/w-d-xo.html

  • @szulerinio
    @szulerinio ปีที่แล้ว +2

    What's the useControls hook?

    • @threeveloper
      @threeveloper  ปีที่แล้ว

      That's a hook I'm using that's offered by the package "leva". It created this little GUI where you can live update some properties ✌️

    • @threeveloper
      @threeveloper  ปีที่แล้ว

      Check out my video about leva if you want to know more about it! 😉 th-cam.com/video/FQ_CIS2YJxA/w-d-xo.html

  • @mykimbui6940
    @mykimbui6940 2 ปีที่แล้ว +1

    Hi, which GUI are you using ? Thank you !

    • @threeveloper
      @threeveloper  2 ปีที่แล้ว +1

      What GUI do you mean exactly? Are you talking about the debug panel? That's from a npm package called "leva". I created a seperate video about this, you should check it out! 😉 th-cam.com/video/FQ_CIS2YJxA/w-d-xo.html

    • @mykimbui6940
      @mykimbui6940 2 ปีที่แล้ว

      @@threeveloper Thank you, that's very helpful :D

    • @mykimbui6940
      @mykimbui6940 2 ปีที่แล้ว

      Do you need to declare the DirectionalLightHelper somewhere ?

    • @threeveloper
      @threeveloper  2 ปีที่แล้ว +1

      @@mykimbui6940 That should be imported from 'three' 👍

  • @ninjarogue
    @ninjarogue ปีที่แล้ว +1

    i can't really follow much of what you are saying.. not sure if it;s the background music or what

    • @threeveloper
      @threeveloper  ปีที่แล้ว +1

      I'm sorry for the sound quality of this video. I was travelling but wanted to create some content from abroad. For this reason, I added english subtitles to the video. Hopefully that will help you out! 😉

    • @ninjarogue
      @ninjarogue ปีที่แล้ว +1

      @@threeveloper all good thank you!

  • @BrosifMcJoseph
    @BrosifMcJoseph ปีที่แล้ว

    aye no music next time bro, video would be way more clear... or drop volume a whole lot

    • @threeveloper
      @threeveloper  ปีที่แล้ว

      Thanks for the feedback ✌️ In my later videos the music should be less loud 😉

  • @ics7778
    @ics7778 8 หลายเดือนก่อน +1

    yor are very fast forwarding most of your points are very hard to understand

    • @threeveloper
      @threeveloper  8 หลายเดือนก่อน

      Thanks for the feedback, I'll slow down future videos 👍

  • @gabrielecicconetti562
    @gabrielecicconetti562 ปีที่แล้ว +1

    it doesnt work it keeps printing a warning three.module.js?d45b:20883 THREE.WebGLShadowMap: has no shadow and no light is casted

    • @threeveloper
      @threeveloper  ปีที่แล้ว

      Hi Gabriele, based on this it's hard for me to answer your question. If you need further help, feel free to reach out to me on my instagram which is linked to in my profile! 👍