hadronized / quaazar

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

Distinction between geometry stage and rasterizer for shader materials #105

Open hadronized opened 9 years ago

hadronized commented 9 years ago

Context

A rendering pipeline is a three stages system:

In theory, materials should branch on the rasterizer stage. Currently, it’s branched on both the geometry stage and rasterizer one, which is wrong, because we have to embed the same geometry part in many of your materials, and that’s annoying.

Solution

Separable shader programs and shader pipelines are the first clues to solve that problem efficiently and elegantly. We then need to introduce new types and concepts to build over the existing material system.

Material shader

A material shader should be a fragment program and should read values from the geometry stage.