Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!tut.cis.ohio-state.edu!sei.cmu.edu!fs7.ece.cmu.edu!o.gp.cs.cmu.edu!andrew.cmu.edu!po0o+ From: po0o+@andrew.cmu.edu (Paul Andrew Olbrich) Newsgroups: comp.graphics Subject: Re: Shading Language (was: AT&T Pixel machine) Message-ID: Date: 18 Mar 91 23:34:44 GMT References: <12303@ur-cc.UUCP> , <1991Mar18.191838.3220@pixar.com> Organization: Class of '92, Carnegie Mellon, Pittsburgh, PA Lines: 44 In-Reply-To: <1991Mar18.191838.3220@pixar.com> Tony Apodaca writes: > If some renderer cannot accept shader files, it is because writing > a renderer which supports user-programmable shading is REALLY HARD, > not because .slo files are somehow magical or secret. The magic is in > the renderer! An easy way to do this is to have your renderer be a big archive or library, and then describe a scene to be rendered using a language such as C. (With a RenderMan-ish syntax.) The scene description is then compiled and linked to the rendering library, forming a big executable which generates your image. You do get the linking overhead, and wind up with a large executable, but this far outweighs the flexibility you get from describing your scenes in C. It is also trivial to write shading routines (again in C) that are called by the rendering library. In comparison to the way most of the existing PD renderers work, this method gives you the extreme flexibility of using a language for scene and shading descriptions, by using an existing parser (the C language.) You avoid the icky business about writing a compiler/loader for the shading routines that the user writes, too. Does this make sense? ... (I'm a little incoherant at the moment after pulling an all-nighter... my apologies.) Drew Olbrich po0o@andrew.cmu.edu PS. If anyone is interested I can answer questions about how to implement something like this. I wrote a ray tracer that works this way with CSG, object heirarchies, K/K bounding slabs, and shading language support. Oh another benefit is when I do animation with this, I can generate a single executable that generates all the frames based on a time parameter. Since scene descriptions are all C, I can throw in splines or make up silly functions to control movement. I did a short physical simulation, and wrote that right into the scene description. To generate the scene for a given frame, it would simulate the dynamics up till that frame. This saves a lot of disk space. This probably should be done in C++, I think, to be truely nifty.