From: Brian P. <br...@va...> - 2000-11-05 22:39:56
|
Keith Whitwell wrote: > > Brian Paul wrote: > > > > > > > Good work, Keith. This is looking really good. > > > > After compiling and taking a quick look over the code I just have a > > couple comments: > > > > 1. _swsetup_RegisterVB() returns a boolean, but in dd.h, the RegisterVB > > function pointer returns void. Which should it be? > > Hmm. If it does fail (it alloc's memory, typically), I'm not sure we can go > on. It might as well exit on failure and return void. > > > 2. I think the SWvertex pointers passed to the point, line and triangle > > functions could/should be const-qualified. Right? > > Probably, yes. I'm looking at the swrast line functions. There's no longer a third provoking vertex parameter like there used to be. For flat-shaded lines it looks like your temporarily changing the 0th vertex's color, calling the line function, then restoring the 0th vertex color. Why not declare a temporary vertex in the line template function, set its color/specular/index fields to the provoking vertex's color and pass it as a third vertex? I see you do something similar for triangles and for two-sided lighting. Here's an idea: Suppose in the SWvertex struct we declare color, specular, and index to be 2-D arrays where the first dimension is the front/back-side index: GLchan color[2][4]; /* color[0] = front, color[1] = back */ Then we could pass a front/back flag to the triangle function to tell it which color to use. Passing a front/back flag might also be useful for culling. Could you put some comments in the swsetup triangle template about the edge flag code? I'm wondering what the 0x1 and 0x2 bits are for and why they're being modified during rendering. It seems to me that the vertex buffer should not be modified during rasterization. -Brian |