Feature Suggestion: Programmable Rendering

Compiling, libraries, modules, coding guidelines and porting

Moderators: jesterKing, stiv

Post Reply
bartrobinson
Posts: 1
Joined: Mon Oct 21, 2002 9:32 pm
Location: Fairfax, VA

Feature Suggestion: Programmable Rendering

Post by bartrobinson »

I hope I'm not repeating any previously mentioned ideas. I searched around a little bit.

I'd like to suggest programmable rendering through python. I guess what this means is a user sets up a python script to control the render engine. Then once the user hits render before each pixel is shaded a callback to the python script takes place. From there the user should be able to read and write to scene variables on multiple levels. Multiple levels would be: geometric (3D pixel location, point or polygon location), surface data (normals, uv's, transparency, etc), lighting (light ray direction, light color, shadow, etc.), camera (position, lens distortion), render image (pixel being shaded, channel in rendered image, etc).

I don't know much about the programming going on with Blender, but it seems to me this wouldn't be that difficult of a thing to add. I say that because the underlying render engine structure and python is already there and functioning. Hopefully it would be be a matter of adding a callback to a python script and making sure the variables needed are available to python. Anyhow I'd love to hear what people think and see something like this in Blender.

I realize this request sounds a little like rendeman shaders, but I think the appeal would be that there is less serious programming involved and no compiling required.

SamAdam
Posts: 0
Joined: Thu Mar 04, 2004 1:28 pm
Contact:

Post by SamAdam »

pixel shaders is what you are talking about.

it would be too slow with bpython, but a plugin would work.

i like the idea, but it isn't super easy to do.

osxrules
Posts: 0
Joined: Wed Jun 02, 2004 6:34 pm

Re: Feature Suggestion: Programmable Rendering

Post by osxrules »

bartrobinson wrote:I realize this request sounds a little like rendeman shaders, but I think the appeal would be that there is less serious programming involved and no compiling required.
Using Python would likely be harder than writing renderman shaders since the Renderman shading language already has built-in definitions for graphics functions. It would mean the developers would have to write the shader code again as I reckon it will be in C/C++ at the moment.

Speed is an issue too although Renderman compilers give you an option to either use interpreted bytecode or output that only runs on one platform but is faster as it isn't interpreted. The first case is what happens with Python code. Shader code also tends to be very compact so the instructions shouldn't take long to load.

If they were things like fur shaders, they might take a while though.

timmeh
Posts: 0
Joined: Wed Jun 29, 2005 5:25 am
Location: Brisbane, Australia

Re: Feature Suggestion: Programmable Rendering

Post by timmeh »

bartrobinson wrote:I hope I'm not repeating any previously mentioned ideas. I searched around a little bit.

I'd like to suggest programmable rendering through python. I guess what this means is a user sets up a python script to control the render engine. Then once the user hits render before each pixel is shaded a callback to the python script takes place. From there the user should be able to read and write to scene variables on multiple levels. Multiple levels would be: geometric (3D pixel location, point or polygon location), surface data (normals, uv's, transparency, etc), lighting (light ray direction, light color, shadow, etc.), camera (position, lens distortion), render image (pixel being shaded, channel in rendered image, etc).

I don't know much about the programming going on with Blender, but it seems to me this wouldn't be that difficult of a thing to add. I say that because the underlying render engine structure and python is already there and functioning. Hopefully it would be be a matter of adding a callback to a python script and making sure the variables needed are available to python. Anyhow I'd love to hear what people think and see something like this in Blender.

I realize this request sounds a little like rendeman shaders, but I think the appeal would be that there is less serious programming involved and no compiling required.
Part of your request, I'm implementing as part of my Google Summer of Code project. We (my mentor and I) will be looking at a way to code a wrapper around render data and provide a script link like interface to allow ou to run a script once render data has been generated.

Details of how it will be implemented haven't been decided yet, but definitely we will be looking at being able to modify renderfaces before rendering actually takes place. A fairly detailed look at this idea can be found here : http://www.blender.org/modules.php?op=m ... pic&t=6332

It would be very cool though to be able to manipulate pixel data though, would allow blender to do paint effects and lens effects.

timmeh

Post Reply