tpalmerstudios / Jeli

A first-person game engine for the beginning developer
GNU General Public License v3.0
2 stars 0 forks source link

[REQUEST] Triangle Rasterization #7

Open tpalmerstudios opened 4 years ago

tpalmerstudios commented 4 years ago

Is your feature request related to a problem? Please describe. Need a way to draw and fill a triangle

Describe the solution you'd like Make a drawTriangle () in FrameBuffer using the drawLine (). Will probably need to research different polygram algorithms

Describe alternatives you've considered Possibly just one drawPoly () to rule them all. I do think this would probably be too bloated to be fast though.

Additional context Once I add in shaddows and I start adding the 3rd Dimension I'll really need to have triangles

tpalmerstudios commented 4 years ago

Looking at SDL2 code I am seeing that they don't even make a triangle rasterizor, they just alias the polygon function with 3 vertices. While I think that a triangle rasterizor should not be difficult and may even add speed, unless I find a great algorithm soon, I'll move on and put this on the back burner

tpalmerstudios commented 4 years ago

So I do have polygon rasterization completely working, it is a little slow, but at this point I want to do a shape rework before I add triangle

tpalmerstudios commented 4 years ago

So this rasterizer is working on one device, but it has float->int errors and it crashes. But 5his comment is only to show that I am working on it. I have also adjusted my line formula so it doesn't bother looping if less than zero