We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 2894 - SOFT RENDER: Textured Triangles
Summary: SOFT RENDER: Textured Triangles
Status: NEW
Alias: None
Product: SDL
Classification: Unclassified
Component: render (show other bugs)
Version: HG 2.0
Hardware: All All
: P2 enhancement
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on: 2888
Blocks: 1734
  Show dependency treegraph
 
Reported: 2015-02-28 02:53 UTC by Jared
Modified: 2016-06-06 20:53 UTC (History)
2 users (show)

See Also:


Attachments
Textured-triangle renderer files. (39.00 KB, application/x-tar)
2015-02-28 02:53 UTC, Jared
Details
Software rendered engine (35.00 KB, application/x-tar)
2015-03-14 14:18 UTC, Jared
Details
Software textured-triangle renderer (39.00 KB, application/x-tar)
2015-03-15 06:22 UTC, Jared
Details
Test program (196.50 KB, application/x-tar)
2015-03-16 05:28 UTC, Jared
Details
Software textured-triangle renderer (38.50 KB, application/x-tar)
2015-03-17 02:14 UTC, Jared
Details
Renderer test (3.50 KB, application/x-tar)
2015-03-17 02:15 UTC, Jared
Details
A software textured-triangle renderer (41.00 KB, application/x-tar)
2015-03-20 03:54 UTC, Jared
Details
Renderer test (203.50 KB, application/x-tar)
2015-03-20 03:55 UTC, Jared
Details
A software textured-triangle renderer (49.00 KB, application/x-tar)
2015-03-22 08:02 UTC, Jared
Details
Renderer test (218.50 KB, application/x-tar)
2015-03-22 08:03 UTC, Jared
Details
A software textured-triangle renderer (44.50 KB, application/x-tar)
2015-03-23 04:48 UTC, Jared
Details
Renderer test (219.00 KB, application/x-tar)
2015-03-23 04:50 UTC, Jared
Details
A software textured-triangle renderer (47.00 KB, application/x-tar)
2015-03-25 05:19 UTC, Jared
Details
Renderer test (210.50 KB, application/x-tar)
2015-03-25 05:21 UTC, Jared
Details
A software textured-triangle renderer (51.00 KB, application/x-tar)
2015-03-27 03:11 UTC, Jared
Details
Renderer test (210.50 KB, application/x-tar)
2015-03-27 03:11 UTC, Jared
Details
A software textured-triangle renderer (51.00 KB, application/x-tar)
2015-03-28 20:07 UTC, Jared
Details
Renderer test (213.50 KB, application/x-tar)
2015-03-28 20:18 UTC, Jared
Details
A software textured-triangle renderer (52.00 KB, application/x-tar)
2015-04-01 03:51 UTC, Jared
Details
Renderer test (214.00 KB, application/x-tar)
2015-04-01 03:52 UTC, Jared
Details
A software textured-triangle renderer (55.50 KB, application/x-tar)
2015-04-24 23:41 UTC, Jared
Details
Renderer test (214.00 KB, application/x-tar)
2015-04-24 23:42 UTC, Jared
Details
A software textured-triangle renderer (57.00 KB, application/x-tar)
2015-05-27 01:48 UTC, Jared
Details
Renderer test (239.50 KB, application/x-tar)
2015-05-27 01:49 UTC, Jared
Details
A software textured-triangle renderer (56.00 KB, application/x-tar)
2015-10-31 18:55 UTC, Jared
Details
Triangle subdivision test. (5.50 KB, application/x-tar)
2015-10-31 18:57 UTC, Jared
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jared 2015-02-28 02:53:10 UTC
Created attachment 2054 [details]
Textured-triangle renderer files.

A software-based 2D textured-triangle renderer.

Intended to act as the software-counterpart to simple 2D triangle renderers for Direct3D and OpenGL. Direct3D and OpenGL counterparts are left to others.
Comment 1 Jared 2015-02-28 02:57:14 UTC
TODO:

Current implementation requires [2888] files to be in the same directory.

Implementation untested.

Implementation needs to be completed (e.g. pixel reading & writing calls).
Comment 2 Jared 2015-02-28 02:58:46 UTC
Comment on attachment 2054 [details]
Textured-triangle renderer files.

Expects to be untared in the same directory as the https://bugzilla.libsdl.org/show_bug.cgi?id=2888 files.

Currently unfinished, and needs refactoring.
Comment 3 Jared 2015-03-14 14:18:33 UTC
Created attachment 2062 [details]
Software rendered engine

A set of files that implement a "pixel-perfect" textured-triangle 2D software renderer. Can be used as a basis for less "pixel-perfect" versions by replacing parts, starting with SRC_TERM.

Currently does everything short of the actual pixel access. Not yet tested for this reason.

Expects to be untar'ed in the same directory as the files from [2888].

Call TRI_REND() to use.
Comment 4 Jared 2015-03-15 06:22:27 UTC
Created attachment 2064 [details]
Software textured-triangle renderer

This version is ready for testing. It expects to be built in the same directory as the SDL headers.
Comment 5 Jared 2015-03-16 05:28:13 UTC
Created attachment 2065 [details]
Test program

A .bmp and a program file to test the textured-triangle software renderer with.
Comment 6 Jared 2015-03-17 02:14:57 UTC
Created attachment 2067 [details]
Software textured-triangle renderer

This has been successfully compiled, and doesn't seem to "explode".
Comment 7 Jared 2015-03-17 02:15:58 UTC
Created attachment 2068 [details]
Renderer test

Successfully runs, but not certain about the output: it's solid black.
Comment 8 Jared 2015-03-20 03:54:09 UTC
Created attachment 2073 [details]
A software textured-triangle renderer

Trying to get this working. Runs, but surface-reading seems to fail... with a program crash as the result.
Comment 9 Jared 2015-03-20 03:55:26 UTC
Created attachment 2074 [details]
Renderer test

Attempts to use the textured-triangle software renderer to actually render something. Currently crashes instead.
Comment 10 Jared 2015-03-22 08:02:33 UTC
Created attachment 2078 [details]
A software textured-triangle renderer

Fixes several functions insode geo_code.xmacro
Adds a VEC_PERP() function.

Partially tested. To turn off debug messages, define NDEBUG.
Comment 11 Jared 2015-03-22 08:03:45 UTC
Created attachment 2079 [details]
Renderer test

Currently testing support code with tri_pretest1.c

To turn off debug messages, define NDEBUG.
Comment 12 Jared 2015-03-23 04:48:42 UTC
Created attachment 2081 [details]
A software textured-triangle renderer

The (separate) pretest runs to completion. The (also separate) renderer test still faults. Debugging continues.
Comment 13 Jared 2015-03-23 04:50:02 UTC
Created attachment 2082 [details]
Renderer test

A set of tests for the renderer. The "pretest" runs to completion, but it's behavior has not been fully verified. The "test" still faults.
Comment 14 Jared 2015-03-25 05:19:08 UTC
Created attachment 2085 [details]
A software textured-triangle renderer

Runs the pretest to completion.
Comment 15 Jared 2015-03-25 05:21:25 UTC
Created attachment 2086 [details]
Renderer test

Runs the pretest to completion, though there still seem to be logic defects.
Comment 16 Jared 2015-03-27 03:11:10 UTC
Created attachment 2094 [details]
A software textured-triangle renderer

Pre-test mostly runs correctly, with no undesired triangles reported.
Comment 17 Jared 2015-03-27 03:11:55 UTC
Created attachment 2095 [details]
Renderer test

Slightly updated pretests.
Comment 18 Jared 2015-03-28 20:07:16 UTC
Created attachment 2098 [details]
A software textured-triangle renderer

Fixed geometry bug: pretest still doesn't pass all tests, but it DOES pass-through enough triangles, and all of the passed-through triangles are within the correct area.

Close enough for the moment. Time to look at actually rendering.
Comment 19 Jared 2015-03-28 20:18:16 UTC
Created attachment 2099 [details]
Renderer test

The pretest now runs to completion, and the only failure is a single mis-formed triangle. The code at fault should be
    TWEEN ( s0,  s2,    p2,    2,  retf[ 2 ] );
in either
    } else if( reti[ 0 ] > 0 && reti[ 2 ] > 0 )
or
    } else if( reti[ 1 ] > 0 && reti[ 2 ] > 0 )

The problem is that it uses the wrong side of the input triangle.

I consider this a minor issue, and therefor will ignore it until later.
Comment 20 Jared 2015-04-01 03:51:20 UTC
Created attachment 2103 [details]
A software textured-triangle renderer

Now places a small number of pixels on the destination surface in one of the tests.
Comment 21 Jared 2015-04-01 03:52:35 UTC
Created attachment 2104 [details]
Renderer test

Test runs to completion, and draws some (not most) pixels to the destination surface.
Comment 22 Jared 2015-04-24 23:41:27 UTC
Created attachment 2134 [details]
A software textured-triangle renderer

More iteration on the software renderer.
Comment 23 Jared 2015-04-24 23:42:17 UTC
Created attachment 2135 [details]
Renderer test

The output bitmaps are vaguely correct, yay!
Comment 24 Jared 2015-05-27 01:48:34 UTC
Created attachment 2162 [details]
A software textured-triangle renderer

Snapshot.
Comment 25 Jared 2015-05-27 01:49:07 UTC
Created attachment 2163 [details]
Renderer test

Snapshot.
Comment 26 Jared 2015-10-31 18:55:47 UTC
Created attachment 2293 [details]
A software textured-triangle renderer

Probably this doesn't have any changes, but it's been long enough that I feel the need to take precautions.
Comment 27 Jared 2015-10-31 18:57:19 UTC
Created attachment 2294 [details]
Triangle subdivision test.

Testing has restarted on the triangle subdivider, since that's the most important part.
Comment 28 Jared 2015-10-31 19:00:17 UTC
Swapped out the testing: the triangle subdivider is all that's tested at the moment, and not very comprehensibly. The image test previously drew within the correct outlines, yet still didn't render the triangle correctly. Since I apparently can't do image manipulation code worth a darn, I'm restraining the tests to geometric concerns.