[Bf-committers] Google Summer of Code Idea

Brecht Van Lommel brechtvanlommel at pandora.be
Fri Mar 16 13:29:38 CET 2007


Hi,

GLSL shader seems like a good idea for SoC.

> I was wondering if creating a prototype of a GLSL shaders edition system 
> like the Lumonix Shader FX (http://www.lumonix.net/shaderfx.html) would 
> be worthy of a Google Summer of Code.

Personally I'd like to see this well integrated with the existing 
material nodes system, ideally making it possible to compile existing 
materials into GLSL, although supporting all options and textures of 
course is not likely to be feasible. GLSL specific nodes could then be 
added as well.

> Anyway, yesterday I started by trying to understand the source code in 
> order to decide where to insert glsl support. I inserted a new field in 
> th G global structure and checked for glsl support in usiblender.c right 
> after the interface's initialization in BIF_init().
> I'd like to know if there's a better place to do that, if the global 
> structure should or not be altered.

I don't think it really needs to be in G. I would probably add a static 
variable in glutil.c and do the GLSL checking there also, and call that 
from BIF_init().

> Either way, right now I'll be starting to create a list of visible 
> objects in the 3D Viewport's current scene, and a list of the materials 
> associated to each object, mesh, etc...
> Again, help would be very useful. Any hints on where to start?

Making a list of objects is probably not needed - if every new 
functionality would do that there would be a lot of wasted code and 
memory. Unless there is a good reason to do this, I would work with the 
existing data structures. Try to integrate it into the drawing system 
somewhere, draw_object in drawobject.c is a good starting point. It's 
not the nicest code, there's a lot of options mixed, but it's probably 
best to plug it in there.

Brecht.




More information about the Bf-committers mailing list