Hi, I'm working on a particular gpu program which relies on having access to the inverse view matrix. So I whipped out my copy of the OGRE material scripts reference and to my surprise I noticed just about any automatic parameter can be filled in on my behalf by ogre - that is, anything except the inverse view matrix.
This made me feel quite unhappy. So I dug into the ogre core sources and found out that there appears to be methods / enums to support this type of auto parameter, just no reference in the material scripts manual. I didn't dig too deep, I just assumed it was an oversight - why else would it be missing from the manual?
So I keyed the parameter into my material script and it didn't work. And after some time pulling my hair out and drinking several cups of wake-up juice, debugging my Cg code and many, many program restarts and much, much script tweaking.. I'm now thinking that maybe my original sin (Assumption..) is the reason it isn't working.
So what's going on guys?
param_named_auto: Inverse View Matrix
- TheGilb
- Halfling
- Posts: 71
- Joined: Sun Oct 06, 2002 11:19 pm
- Location: UK
- Contact:
- sinbad
- OGRE Retired Team Member

- Posts: 19269
- Joined: Sun Oct 06, 2002 11:19 pm
- Location: Guernsey, Channel Islands
- x 67
- Contact:
No, everything that's supported is in the manual. There is no inverse view, but there is an inverse worldview. A quick read of MaterialSerializer would have confirmed that it agrees with the manual, it wouldn't have taken half as long! 
What use is the inverse view anyway? I can add it easily enough, but I can't think of any calculation that's useful to go from camera space to world space - camera to object space maybe, but world space isn't that useful since it requires a transform for both ends (object space vertex / normal and camera information). That's why inverse worldview is mainly used, because you don't need to transform the vertex into (just) world space before you can use it.
Anyway, I'll hook it up in the .material scripts.
What use is the inverse view anyway? I can add it easily enough, but I can't think of any calculation that's useful to go from camera space to world space - camera to object space maybe, but world space isn't that useful since it requires a transform for both ends (object space vertex / normal and camera information). That's why inverse worldview is mainly used, because you don't need to transform the vertex into (just) world space before you can use it.
Anyway, I'll hook it up in the .material scripts.