ImageEngine / cortex

Libraries for visual effects software development
Other
528 stars 123 forks source link

Renderers to use doubles instead of (or in addition to) floats #286

Open andrewkaufman opened 10 years ago

andrewkaufman commented 10 years ago

SceneInterface provides transforms as M44d, but the Renderers only accept M44f. I think there are other cases where we have to convert between the two all the time as well. Can we just support double now? Or both at least? Does this seem reasonable for Cortex 9 or should it wait?

johnhaddon commented 10 years ago

I'm not sure what the immediate value is in this - as far as I know both RenderMan and Arnold only accept matrices as floats. It's a relatively simple change though if we just want to future proof ourselves. I'd say a higher priority might be to change the transform representation in Gaffer to use doubles - so we get higher precision during computation even if we have to convert to float for the renderer. Shall we make a ticket for that?

I don't think we should support doubles for primvars at all though - too much memory usage for too little benefit, plus having to convert huge arrays down to float to give them to the renderer. Some Ops support doubles there and some don't, but I'm unaware of us ever actually using doubles rather than floats. I think I'd even like to just remove the double processing at some point, to simplify the code and reduce library size.

andrewkaufman commented 10 years ago

The immediate value was from an internal ticket: Cortex 3delight Renderer should support M44d attributes. This would allow Mathias to see Mref in his shader preview scene.

Gaffer transforms as doubles sounds good. Want to make that and stick it in a milestone?

johnhaddon commented 10 years ago

Cool - ImageEngine/gaffer#860, in the Misc Enhancements milestone for now.