-
Notifications
You must be signed in to change notification settings - Fork 2
Shader Tutorial for Advanced Shader Programmers
JesseKlugmann edited this page Oct 16, 2011
·
4 revisions
OpenGL is a modern graphics api with support for high-performance shaders. Elysion is also capable of shaders and provides easy to use tools for accessing and using shaders. It's very easy to port your game from fixed-function pipeline elysion-code to high-performance shader-driven code:
- Rename all your sprites instances to TelShadedSprite. This class renders a simple sprite with a pair of shaders( vertex and fragment shader ). A TelShadedSprite implementes basic shader management and usage on top of the TelSprite class and allows you to render your very own materials with lighting and textures. Don't forget to load all your shaders correctly:
var sprite : TelShadedSprite; sprite := TelShadedSprite.Create; sprite.LoadShaders(GetResPath + 'shaders/sepia.fs', GetResPath + 'shaders/svs.vs');
- Elysion provides a simple class for post-processing effects:
var post : TelPostProcess; post := TelPostProcess.Create(GetResPath + 'shaders/blur.fs', GetResPath + 'shaders/svs.vs'); post.BeginProcess(); ...render all your stuff post.EndProcess(); post.Draw();