|
From: Roger H. <rog...@mi...> - 2007-03-13 00:42:24
|
On 12 Mar, 2007, at 19:54, James Walker wrote: > Roger Holmes wrote (on 2/17/07): > >> I would like to go back to being able to store lights in display >> groups, >> preferably so that when their group gets submitted, they get added >> to the light group so that I would no longer have to do a pre-pass >> to read all the lights and add them to the light group myself with >> their correct transforms and then afterward remove them from the >> light group. Lights are real things in the real world, we do not need >> to do anything with them until EndRender time, so why do they >> have to be known before StartRender time? > > While I agree that it would be nice to be able to have lights anywhere > in the scene, I don't know how to do it without two passes. > > I don't know what you mean by "go back to being able to store > lights in > display groups". When was this possible? The QD3D manual says: "A > display group is a group of objects that are drawable. Drawable > objects > include geometric objects, styles, transforms, attributes and > attribute > sets, and other display groups." No mention of lights. I think the manual was published after version 1.0 shipped. We had a series of much more detailed specs up to that time (I wish I still had them - some tidy person threw them away because 'we have the proper manual now'). I think it was about version 1.2 that Apple made display groups reject the adding of a light. Not that they ever had any effect, I always had to do a rendering pre-pass. Now I have to do pre-passes before rendering, before saving (to convert lights to custom attributes and custom light groups to display groups) and do a post pass after reading to convert them back again. I also do special processing during the finding of bounding boxes and bounding balls so that they include the lights, and have to have light widgets so that picking works. > > In answer to the question "why do they have to be known before > StartRender time", my answer is: because any OpenGL-based renderer > needs > to have the lights set up before you render anything that should be > lit > by said lights. Well if that is a restriction of OpenGL then fair enough. I just think that no processing of lights can be done until a (non shadow) renderer has the Z buffer set up with depths and references to the triangles, and whilst the renderer builds the list of triangles (and culls some) it could have set up the list of lights whilst it parsed the group structures. |