Udemy
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
Intermediate Three.js with Shaders
Rating: 4.6 out of 5(136 ratings)
1,718 students

Intermediate Three.js with Shaders

Create an interactive 3d globe with custom ThreeJS shaders
Created byChristopher Lis
Last updated 3/2022
English
English [Auto],

What you'll learn

  • Create and understand ThreeJS shader composition and setup
  • How to import textures into your shader to create a globe
  • How to create vertex and fragment shaders
  • How to import shaders into a vite project
  • Understand complex 3D terms like normals, attributes, varyings, and UVs
  • How to draw interactive data points onto a globe with latitude and longitude
  • How to import bulk data and read it onto a scene
  • How to animate generated meshes with GSAP
  • How to add click and drag functionality to the globe
  • How to scale a 3D scene for smaller screen sizes
  • How to add mobile event listeners

Course content

2 sections23 lectures4h 18m total length
  • Introduction1:53
  • Create a Sphere5:26

    This intermediate three.js tutorial shows creating a sphere mesh with sphere geometry (radius five, 50 width and height segments) and a red material, then positions the camera at z ten.

  • Map Texture Onto Sphere2:30
  • Sharpen Rendering2:36

    Sharpen rendering by enabling anti-aliasing in WebGL render options and using the device pixel ratio for higher detail with custom shaders.

  • Create A Vertex Shader10:58
  • Create A Fragment Shader3:31

    Create a fragment shader to fill pixels in a WebGL scene, learn the main function, set fragment color, and import it alongside the vertex shader in a Three.js workflow.

  • Modify Vertex Shader for Use With Three.js7:27
  • Add Texture to Fragment Shader11:40

    Pass a texture into the fragment shader via a uniform. Use texture2D with UV coordinates from the vertex shader to apply the globe texture.

  • Add Blue Shade to Earth Texture8:03
  • Add Atmosphere8:02
  • Add Mouse Movement Interaction6:25

    Add mouse movement interaction by listening for mouse move events, normalizing coordinates to 0–1, and rotating a group containing the sphere using GSAP interpolation for smooth, responsive control.

  • Add Background Stars6:12

    Create a star geometry and a points object in three.js, then populate 10,000 stars with a float32 buffer attribute for positions. Place them behind the earth with negative z.

  • Add HTML & CSS18:07

Requirements

  • You must have development environment with ThreeJS setup already - I use Vite here for mine, which you can learn how to do by taking my Modern ThreeJS course also on Udemy
  • Vite with ThreeJS installed is recommended for a frontend server, but not required
  • ThreeJS version ^0.128.0 is recommended (it's what's used in the course), but not required
  • You should have a basic math background (the basics of matrices are covered, but not to the detail of a math course)

Description

PLEASE READ: This is a freemium course—the first hour and a half are free (you can watch right here on Udemy [or YouTube] with each video's "Preview" button), while the remaining 3 hours require course purchase. I've always been a big advocate of spreading the basics to as many people as possible, as I believe knowledge and personal growth are some of the best ways to better our world as a whole. Enjoy.

Welcome to the Intermediate ThreeJS with Shaders course, where you will learn how to create an interactive 3d globe with custom ThreeJS shaders.

My name is Christopher Lis, and I'm an award winning Full-Stack Engineer with over ten years of web development experience. I've directly worked with clients like Harvard University, The Basketball Tournament, and premium award winning agencies like Brave People.

The goal of this course is to get you writing your own custom ThreeJS shaders with GLSL, and to help you understand how to import these shaders into a practical ThreeJS scene. You'll also learn how to dynamically place data points on a globe based on the latitude and longitude of different countries. There are little to no videos out there that actually go into this topic in-depth so I figured I should tackle it.

In this course, you'll learn everything from:


- Vertex Shaders

- Fragment Shaders

- Import Shaders with Vite Plugins

- Normals

- Uniforms

- Attributes

- Varyings

- Point clouds and particles

- Bulk Data Imports

- Rectangular Mesh Animation

- Click and Drag Functionality

- Scene Responsiveness

- Touch Event Listeners


And so much more.

If you're serious about taking your ThreeJS skills to the next level, then shaders are logically the next step after become acquainted with the framework. Let me guide you through the full production of a 3d scene you can actually use for a real website.

Who this course is for:

  • Intermediate ThreeJS Developers who know how to create scenes with materials, geometries, and meshes