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 Ian » Wed Apr 05, 2017 3:25 pm

Maybe I am missing something obvious, I don't know

I changed 8-11 to

Code: Select all
         for (xi = x; xi < (x + width); xi++)
         {
            texel = src[yi * 2048 + xi] & 0xFF;
            c = (texel & 0xF) * 17;
            scratch[i++] = c;
            scratch[i++] = c;
            scratch[i++] = c;
            scratch[i++] = c;
         }


Fragment shader to

Code: Select all
   "if(textureInverted) {\n"
      "tex1Data = vec4(1.0) - vec4(tex1Data);\n"
   "}\n"
Ian
 
Posts: 2044
Joined: Tue Feb 23, 2016 9:23 am

Re: 4 bit texture bug

Postby HarryTuttle » Wed Apr 05, 2017 3:28 pm

Ian wrote:Maybe I am missing something obvious, I don't know

I changed 8-11 to

Code: Select all
         for (xi = x; xi < (x + width); xi++)
         {
            texel = src[yi * 2048 + xi] & 0xFF;
            c = (texel & 0xF) * 17;
            scratch[i++] = c;
            scratch[i++] = c;
            scratch[i++] = c;
            scratch[i++] = c;
         }


Fragment shader to

Code: Select all
   "if(textureInverted) {\n"
      "tex1Data = vec4(1.0) - vec4(tex1Data);\n"
   "}\n"


The fence in the precedent post is type "6", don't know why it was inverted... anyway, the alpha channel for 8-11 is always inverted, but rgb values only when you, rightfully, set the inverted bit by means of "translator map offset = 2"
User avatar
HarryTuttle
 
Posts: 646
Joined: Thu Mar 09, 2017 8:57 am

Re: 4 bit texture bug

Postby HarryTuttle » Wed Apr 05, 2017 3:31 pm

In pseudo-code:
Code: Select all
if (textureType > 7 && textureType < 12) {
  tex1Data.a = 1.0 - tex1Data.a;
}

if(textureInverted) {
  tex1Data.rgb = vec3(1.0) - tex1Data.rgb;
}
User avatar
HarryTuttle
 
Posts: 646
Joined: Thu Mar 09, 2017 8:57 am

Re: 4 bit texture bug

Postby Ian » Wed Apr 05, 2017 3:32 pm

I'll try that :)
Ian
 
Posts: 2044
Joined: Tue Feb 23, 2016 9:23 am

Re: 4 bit texture bug

Postby Ian » Wed Apr 05, 2017 3:38 pm

Well harley looks correct, but still no black around the text
Ian
 
Posts: 2044
Joined: Tue Feb 23, 2016 9:23 am

Re: 4 bit texture bug

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

strange... I've just followed the current, official build solution regarding types 8-11, with only one variation: I changed alpha channel interpretation from "0" or "1" (like a contour texture should be anyway) to the full 16 grey-level, but in both solutions alpha is 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 3:56 pm

Dunno, seems to look correct now. I forced a rebuild ..
Ian
 
Posts: 2044
Joined: Tue Feb 23, 2016 9:23 am

Re: 4 bit texture bug

Postby HarryTuttle » Wed Apr 05, 2017 3:59 pm

:)
User avatar
HarryTuttle
 
Posts: 646
Joined: Thu Mar 09, 2017 8:57 am

Re: 4 bit texture bug

Postby model123 » Thu Apr 06, 2017 7:31 am

Great progress!!

Image
Image
Image

Thank you for a great job!
Supermodel developer
model123
 
Posts: 108
Joined: Wed Mar 08, 2017 8:34 am

Previous

Return to The Dark Room

Who is online

Users browsing this forum: No registered users and 1 guest

cron