Forum: Poser - OFFICIAL


Subject: Node Based Human Irises

bagginsbill opened this issue on May 17, 2007 · 67 posts


bagginsbill posted Sat, 19 May 2007 at 5:31 PM

You got it, Kuro. I made a library of objects, one for each Poser node. I also made a Color object and a few others. I defined syntax that would let you construct the nodes using Python constructor invocation. I defined overloaded math operators, so that, for example when you add two nodes, the result is a Math/Add node pointing at the other two nodes. 

Matmatic scripts are in fact Python scripts. However, the environment they run in is prepared by the Matmatic script first, so you can make a lot of extra assumptions about what happens before and after your script runs. For example, in pure Python, you'd have to do "from matmatic.nodes import *", among many others, but I've already done all those for you.

There is a bit more - the nodes do some simple local optimizations. For example, quite often, multiplication can be accomplished without a Multiply node, simply because every connection between nodes has a number or color on it that is a built-in multiply. Matmatic tries to find aggressive ways to use those. It will also do smart stuff, like if you ask for sqrt(x) and x is a node, then you also get a Math:Sqrt node, but if x is a number or color, it will do the sqrt in python and just write the resulting number into the shader as a constant.

I'm working on more optimizations. The most important is common sub-expression elimination. This will automatically reduce the node count when repeated sub-shaders are discovered. There are more features I have in mind for improving speed.


Renderosity forum reply notifications are wonky. If I read a follow-up in a thread, but I don't myself reply, then notifications no longer happen AT ALL on that thread. So if I seem to be ignoring a question, that's why. (Updated September 23, 2019)