PROGRAMMING > Freebasic
Triangles again!
Stonemonkey:
Not having done much for a while I've been looking at triangles again. It's not really doing much atm, affine mapping with vertex colour modulation. Anyway, I remembered Jim suggesting ages ago about using types for the edges so using that I found I can get away with only calculating the gradients down the main edge no matter what side it's on and the clip/sub-pixel code can still take care of it without any changes and only the gradient for x is needed for the short edges.
Not very exciting but thought it was pretty cool as it tidies up some things I didn't like before.
Stonemonkey:
Taken this a bit further now and got some cubes, to allow some flexibility, instead of shading the pixels in the rasterizer I am just writing the shade value into the alpha channel then shading in a pass over the buffer after rendering. I did this before for doing stencil shadows so only 1 pass was needed. I wasn't masking the alpha from the texture in the rasteriser and thought I should just make sure there's no alpha in the texture to interfere with the shading.
Anyway, I was just trying to come up with a way using the brushes to switch shading on/off for the triangles when I noticed I could just write &ff into the alpha of a texel and it won't be shaded.
Might be other stuff I can do with this too, not sure what yet but I could make the shading 7 bit instead and use the last bit in the texture for other things, any ideas anyone?
ttemper:
WOW, you've been busy, and a nice 3d engine to boot. I'd like to see this in action, got any binary examples to show? I can definitely learn from this, excellent stuff Stonemonkey.
*edit, nevermind about that binary, I should have read the whole code first, saw the loops at the end. nice once. looks fantastic.
Stonemonkey:
It's mostly some old stuff I'm trying to cobble together with some new bits n pieces since I've not done anything for ages.
Kirl:
Can you post an exe?
Navigation
[0] Message Index
[#] Next page
Go to full version