hadronized / quaazar

Realtime 3D engine
BSD 3-Clause "New" or "Revised" License
6 stars 2 forks source link

Shaders #17

Closed hadronized closed 9 years ago

hadronized commented 10 years ago

Introduction

Shaders are a useful way to alter a material. But they’re not only reserved for material purposes. For instance, we can use them to build frame shaders – used for post-process effects.

What’s a shader exactly?

A shader is a function. It’s always a function, nothing more. For instance, a vertex shader is a function from a vertex to another vertex. Shaders are endomorphisms. They work on an object and returns the altered object. They have access to environment variables, like time, source textures, resolution and so on and so forth.