[solved in shoggoth]pragma in material/ pass / texture_unit

What it says on the tin: a place to discuss proposed new features.
Post Reply
User avatar
madmarx
OGRE Expert User
OGRE Expert User
Posts: 1671
Joined: Mon Jan 21, 2008 10:26 pm
x 51

[solved in shoggoth]pragma in material/ pass / texture_unit

Post by madmarx »


EDIT : this is possible in ogre 1.6, according to this (latter) thread :
http://www.ogre3d.org/phpBB2/viewtopic.php?t=41073



Hello,

I suggest to add a pragma into material / pass / texture_unit. It's like a user defined information. It could be extremely useful, when a new effect must be developped and tested, without directly produce a patch for it that changes the parser.

Code: Select all

material
{
         pragma  (nameOfpragma1, what ever you want on the line)    
         pragma  (nameOfpragma2, another information)

          technique
             {
                    pass firstpass
                      {
                               pragma (passToTexture, myRTT)
                               pragma (useNvidiaUnfoldShader, true)

                               texture_unit
                               {
                                     dog.jpg
                               }
                               ...
                      }
              }
}

Then the programmer just has to make :

Code: Select all

myMaterialPtr->hasPragma("nameOfpragma1");
String myPragma = myMaterialPtr->getPragma("nameOfpragma1");
Same goes for :
Technique / Pass / TextureUnit
(even if maybe Technique is already ok with the scheme feature). It permits lots of customization (for exporters / importers), and prototyping easily new feature (for example the new blend in Shoggoth). It could also be named 'userInfo' instead of pragma...

What do you think?[/b]
Post Reply