Shaders In XVR
From VRwiki
This tutorial shows a number of different scenarios, displaying how to use shaders in XVR:
- the difference between independent shaders and embedded shaders
- how to pass textures to shaders
- how to pass custom values (uniforms) to shaders
- how to load meshes containing vertex attributes
You will also find ideas on what you can do with shaders in your applications.
Contents |
[edit]
Scenarios
- classic shading
- simple independent shader
- how shaders affect OpenGL code
- simple embedded shader
- per pixel lighting
- passing uniforms
- passing uniforms to embedded shaders
- multitexturing
- passing textures to embedded shaders
- effect with multitexturing
- multipass example (fur)
- normal mapping
- parallax mapping
- using framebuffer objects (FBOs)
- postprocessing example
- shadowmapping example
- environment mapping example
- fbo cubemap example
- vertex attributes example (morphing)
- combined vertex and fragment shader animation
- bonus effect (spawn animation)
[edit]
How to interact
- page down: go to next scenario
- page up: go to previous scenario
- r: default camera view
- t: top camera view
Drag the mouse with left button or right button to rotate or pan the view respectively.
[edit]
Tutorial application
You can use the skeleton of this application also to write your own tests, enjoying a very easy interface to create sliders, color sliders, keyboard toggles.
- subclass the scenario class
- add it to the "scenarios" global variable, like this: ui.process_ui(your_class_name())
[edit]
Download
Download from here.
[edit]

