4 bit texture bug

Technical discussion for those interested in Supermodel development and Model 3 reverse engineering. Prospective contributors welcome.
Forum rules
Keep it classy!

  • No ROM requests or links.
  • Do not ask to be a play tester.
  • Do not ask about release dates.
  • No drama!

Re: 4 bit texture bug

Postby Bart » Wed Apr 05, 2017 1:57 pm

Jiterdomer wrote:"L.A. Machineguns: Rise of the Machines", shouldn't be it called "L.A. Machineguns: Rage of the Machines"?


Good catch! Fixed.
User avatar
Bart
Site Admin
 
Posts: 3086
Joined: Thu Sep 01, 2011 2:13 pm
Location: Reno, Nevada

Re: 4 bit texture bug

Postby Ian » Wed Apr 05, 2017 2:14 pm

HarryTuttle wrote:
Ian wrote:Hopefully that commit didn't break any other games!

I tested some games using those type 8-11 textures (1-4 with contour) and all seem fine :)

I would suggest just to change the way their alpha channel is interpreted; now is always inverted being 1 or 0, however since they're luminance texture they should blend more smoothly. So you could either change in <texture.cpp>, for texture 8-11:
Code: Select all
scratch[i++] = 255 - c;

or pass "currentMesh->format" as uniform to the fragment shader and fetch that value to make the inversion. I was checking LA Machineguns attract demo and at least type 8 is used in buildings glasses, which are alpha blended.


Are you saying the alpha is inverted too?
Ian
 
Posts: 2044
Joined: Tue Feb 23, 2016 9:23 am

Re: 4 bit texture bug

Postby HarryTuttle » Wed Apr 05, 2017 2:23 pm

Bart wrote:Compile with DEBUG defined (add -DDEBUG to command line parameters and rebuild from scratch) and then:

1. Make a directory called Analysis.
2. Run: supermodel roms\dayto2pe.zip -gfx-state=saves\dayto2pe.st0

You specify a ROM set and a save state file. It'll then write a bunch of files to Analysis/ and you can open up the html file it produces there

Bart, maybe I missed something but:

- compiling with -DDEBUG means that I've also to enable the internal debugger in Supermodel? Because not doing so it won't compile;
- as soon as I run a game specifying also a save state the emulator exits immediately without doing anything and not throwing any error message to the console;

UPDATE:
after r576 it won't compile at all saying:
Code: Select all
Compiling Src/OSD/SDL/Main.cpp...
Src/OSD/SDL/Main.cpp: In function 'void TestPolygonHeaderBits(IEmulator*)':
Src/OSD/SDL/Main.cpp:468:24: error: variable 'std::ofstream fs' has initializer but incomplete type
   std::ofstream fs(file);
                        ^
User avatar
HarryTuttle
 
Posts: 646
Joined: Thu Mar 09, 2017 8:57 am

Re: 4 bit texture bug

Postby HarryTuttle » Wed Apr 05, 2017 2:25 pm

Ian wrote:Are you saying the alpha is inverted too?


For texture 8-11 yes, always, no matter what translator map offset's value is
User avatar
HarryTuttle
 
Posts: 646
Joined: Thu Mar 09, 2017 8:57 am

Re: 4 bit texture bug

Postby Ian » Wed Apr 05, 2017 2:28 pm

So the middle part of this is supposed to be transparent ?

Image
Ian
 
Posts: 2044
Joined: Tue Feb 23, 2016 9:23 am

Re: 4 bit texture bug

Postby HarryTuttle » Wed Apr 05, 2017 2:34 pm

It should be as it reveals the underlying polygon color, I'm referring to Daytona 2 cars' decals. In that case it's the polygon that "colorize" the numbers.
User avatar
HarryTuttle
 
Posts: 646
Joined: Thu Mar 09, 2017 8:57 am

Re: 4 bit texture bug

Postby Ian » Wed Apr 05, 2017 2:41 pm

some pics would help :)
Ian
 
Posts: 2044
Joined: Tue Feb 23, 2016 9:23 am

Re: 4 bit texture bug

Postby HarryTuttle » Wed Apr 05, 2017 2:45 pm

Inverted:
du2_04.jpeg
du2_04.jpeg (216.41 KiB) Viewed 8411 times


Not inverted:
du2_05.jpeg
du2_05.jpeg (216.76 KiB) Viewed 8411 times


Please note, however, that your current solution is fine, I've made myself a bit unclear before, I just meant to not set alpha to 0 or 1, but reuse the same "c" value (used for r,g,b) to also alpha channel, but inverted.
User avatar
HarryTuttle
 
Posts: 646
Joined: Thu Mar 09, 2017 8:57 am

Re: 4 bit texture bug

Postby Ian » Wed Apr 05, 2017 2:50 pm

Yeah that's interesting ..
I hadn't tried battle on the edge
It looks quite broken. Maybe there is an alpha inversion bit?

Image
Ian
 
Posts: 2044
Joined: Tue Feb 23, 2016 9:23 am

Re: 4 bit texture bug

Postby HarryTuttle » Wed Apr 05, 2017 2:54 pm

Wait... mine is fine!
du2_06.jpeg
du2_06.jpeg (213.3 KiB) Viewed 8404 times
User avatar
HarryTuttle
 
Posts: 646
Joined: Thu Mar 09, 2017 8:57 am

PreviousNext

Return to The Dark Room

Who is online

Users browsing this forum: No registered users and 1 guest

cron