Hology
Hology
Hology
  • 👋Welcome to Hology Docs
  • Getting started
    • Introduction to Hology
    • The first steps
    • Editor basics
      • Flying in scenes
      • Placing objects
      • Select objects
      • Transform
      • Grouping objects
      • Duplicate
    • Starter project - Third person shooter
  • Tutorials
    • Rolling ball - Gameplay programming
    • Character movement programming
    • Character AI behavior
  • Release
    • Distribution
      • Discord Activities
      • Facebook Instant Games
      • Upload to Itch.io
      • Host with GitHub Pages
      • Publishing to Steam
      • iOS and Android
  • Assets
    • 3D Models
      • Custom collision shapes
      • Material slots
    • Materials
    • Textures
    • Prefabs
  • Gameplay
    • Actors
      • Creating actor classes
      • Actor parameters
      • Actor components
      • Actor lifecycle
      • Spawning actors
      • Moving actors
    • Services
      • Load assets
    • Player input
    • Collision detection
    • Physics
      • Physics body types
      • Applying forces
      • Ray casting
    • Trigger volumes
    • Character movement
    • Pointer events
    • Animation
      • Animation system
      • Character Animation
      • Animation State Machine
    • Sound
      • Audio parameter
    • World
    • Navigation
  • Shaders
    • Introduction to shaders
    • Creating shaders
    • Shader parameters
    • Typescript shaders
      • Types
      • Math functions
      • Attributes
      • Varying
      • Uniforms
      • Textures
      • Arrays
      • Select
      • Lighting
    • Painted materials
    • Water shader tutorial
  • Level design
    • Landscape sculpting
    • Landscape painting
    • Grass
  • User Interfaces
    • Creating user interfaces
    • Using React
    • VR
  • Visual Effects
    • Introduction to VFX
    • VFX Assets
  • Integrations
    • Arcweave
Powered by GitBook
On this page
  1. Shaders

Introduction to shaders

Everything rendered on the screen needs shaders. Shaders are small programmes that run on the GPU (graphics processing unit) very efficiently. These programmes calculate both the position of geometry vertices on the screen and the color of each fragment.

When do you need custom shaders?

For some visual styles, you may not need to to create your own shaders. Built in shaders support basic functionality like projecting vertices to screen space, configuring a specific color, texture, while also calculating how lights affect the color.

However, when this is not enough, you may have to create your own shaders. Some examples

  • Vertex animation: You can transform the position of the geometry's vertices. This can be done to make an object spin around an axis or make foliage look like it is swaying in wind. As this happens on the GPU, it is very efficient as opposed to doing this on the CPU.

  • Mixing materials: A mesh can only have one material rendered at a time. If you want to display different materials on different parts of a mesh, you can use a custom shader. You can for example use the angle of the surface to decide which color to render.

PreviousNavigationNextCreating shaders

Last updated 1 year ago