I'd like to build a custom OSL Emission shader which behaves as follows:
1) Input parameters:
- float Initial = 0 // minimum emission intensity
- float Final = 1 // maximum emission intensity
- output closure color Emission = 0
3) Applied to a plane with Origin at the left side edge it produces a light emission varying (linearly or by whatever else rule) from:
Initial at left side edge
Final at right side edge
I've no problems applying the Initial rule but can't figure out how to apply the Final.
Initial emission is to be assigned at X=0 (in Object coordinates) but what about Final emission?
If I knew information about the size of the current object I could derive the rule to make the emission assume the Final value at the right edge.
Is there a way to get such information inside an OSL script?