OGRE Wiki
Support and community documentation for Ogre3D
Ogre Forums
ogre3d.org
Log in
Username:
Password:
CapsLock is on.
Remember me (for 1 year)
Log in
Home
Tutorials
Tutorials Home
Basic Tutorials
Intermediate Tutorials
Mad Marx Tutorials
In Depth Tutorials
Older Tutorials
External Tutorials
Cookbook
Cookbook Home
CodeBank
Snippets
Experiences
Ogre Articles
Libraries
Libraries Home
Alternative Languages
Assembling A Toolset
Development Tools
OGRE Libraries
List of Libraries
Tools
Tools Home
DCC Tools
DCC Tutorials
DCC Articles
DCC Resources
Assembling a production pipeline
Development
Development Home
Roadmap
Building Ogre
Installing the Ogre SDK
Setting Up An Application
Ogre Wiki Tutorial Framework
Frequently Asked Questions
Google Summer Of Code
Help Requested
Ogre Core Articles
Community
Community Home
Projects Using Ogre
Recommended Reading
Contractors
Wiki
Immediate Wiki Tasklist
Wiki Ideas
Wiki Guidelines
Article Writing Guidelines
Wiki Styles
Wiki Page Tracker
Ogre Wiki Help
Ogre Wiki Help Overview
Help - Basic Syntax
Help - Images
Help - Pages and Structures
Help - Wiki Plugins
Toolbox
Freetags
Categories
List Pages
Structures
Trackers
Statistics
Rankings
List Galleries
Ogre Lexicon
Comments
History: ShOgre
View page
Source of version: 3
(current)
{DIV(class="Layout_box13")}This page is kept for historic reasons - ShOgre doesn't exist any more.{DIV} {maketoc} !ShOgre This page deals with the ShOgre library which allows the Sh GPU metaprogramming language to be used as a shader language in Ogre. Note that it is currently alpha code, and needs testing. !!What is ShOgre? ShOgre is a library that provides glue code between the Sh GPU metaprogramming language and the Ogre rendering engine. Ogre can use most of the available high level shading languages like -GLSL, HLSL, Cg, so you might be wondering "Why another one?". Well, the greatest advantage of Sh above those other languages is a that shader objects are completely built from C++. No other language has to be learnt. This also allows for the easy and automatic generation of different shader permutations for the amount and type of lights, the availability of hardware skinning and vertex blending, normal mapping and other material parameters. If desired, the syntax tree of the shader can be built and edited directly. Shader blocks can be conveniently combined and re-used using shader algebra. Another advantage of Sh above other shading languages is that calculations that can be done outside the shader are "lifted" to the CPU, so that these are not executed per fragment or per vertex but once per shader invocation. Also, Sh is completely transparent to the render system used. The current backends are ((-GLSL)) and ARB ((assembly language|assembly)) for ((-OpenGL)). A ((HLSL)) backend is planned for ((Direct3D)) support. !!Download The package can be downloaded [http://orion.servicez.org/ogre/ShOgre-demo1.zip|here]. It includes * An executable for windows, which can be found in Demos/bin/Release * Source code * Project files for windows(Visual C++ 7.1) and Linux (gcc 3.4+). !!Building Sh has its own GPU program parameter and texture management, making the plugin tightly coupled to the -OpenGL RenderSystem. This allows it to do various things like updating parameters in its own way. Modifying Sh to do these operations through the Ogre API would be a lot of work. This will be done eventually, but the point of this demo is to show that Sh and Ogre can be conveniently used together. This coupling makes that the plugin must be linked directly to the Plugin_GLRenderSystem library, which is easy under Linux (in which a plugin is just a library) but somewhat more involved in Windows as the neccesary symbols must be exported from the DLL. The first step, whether building for Linux or Windows, is to get the latest Dagon (1.1.x) branch from CVS. This is described on the Ogre developers page [http://www.ogre3d.org/index.php?option=com_content&task=blogcategory&id=74&Itemid=87|here]. !!!Linux On Linux, no changes to Dagon are needed, just configure and build Ogre the normal way. The build process of the demo is a matter of setting the Ogre base path in the Makefile and typing 'make'. Before running the demo one needs to set the LD_LIBRARY_PATH to include the plugin path, {MONO()}$ LD_LIBRARY_PATH=$(OGRE_PREFIX)/lib/OGRE{MONO} in which OGRE_PREFIX is the prefix in which OGRE was installed, ''/usr/local'' by default. !!!Windows Compiling the library on Windows is somewhat more tricky as it requires Plugin_GLRenderSystem to export the GLGpuProgram object, so it can hook into bind unbind and the parameter passing functions. * First, apply this [http://orion.servicez.org/ogre/ShOgre_GL.patch|patch] to the Dagon source code ** In the project settings of RenderSystem_GL, C/C++ > Preprocessor > Preprocessor Definitions add ";OGREGL_NONCLIENT_BUILD" (without the quotes, obviously) ** Do a full build of Ogre ** Now Ogre is ready for the Sh Plugin * You can now build the plugin and the demo !!Usage Using Sh as a shading language in Ogre is somewhat different than using the other shading languages, but also has a lot in common... ... todo ... !!Screenshots Some shots of the ShOgre demo in action are shown below. {img src="img/wiki_up/Shogre_1_small.jpg" alt="Shogre 1 small.jpg"} * Phong shader, dynamically built by a C++ object. {img src="img/wiki_up/Shogre_2_small.jpg" alt="Shogre 2 small.jpg"} * Anti-aliasing checkerboard shader {img src="img/wiki_up/Shogre_3_small.jpg" alt="Shogre 3 small.jpg"} * Athene mesh displayed with Glass shader
Search by Tags
Search Wiki by Freetags
Latest Changes
Minimal Ogre Collision
Artifex Terra
OpenMB
Advanced Mogre Framework
MogreSocks
Critter AI
Mogre Add-ons
MOGRE
Mogre MyGUI wrapper
MOGRE Editable Terrain Manager
...more
Search
Find
Advanced
Search Help
Online Users
16 online users