no texture filtering

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!

no texture filtering

Postby solitarius576 » Sun Nov 10, 2019 1:36 pm

i would like to play with point filtering
i modified the occurrences of gl_linear to gl_nearest
but only the 2d elements seems to render with point filtering
is there a way to achieve this or the texture filtering is done with shaders?
thx
solitarius576
 
Posts: 39
Joined: Thu Oct 20, 2016 10:33 pm

Re: no texture filtering

Postby Bart » Sun Nov 10, 2019 10:05 pm

The old engine does filtering in the shaders. But if you're running the new engine (which has been the default in SVN builds for a couple years now), check out Src/Graphics/New3D/Texture..cpp in CreateTextureObject().
User avatar
Bart
Site Admin
 
Posts: 3086
Joined: Thu Sep 01, 2011 2:13 pm
Location: Reno, Nevada

Re: no texture filtering

Postby solitarius576 » Mon Nov 11, 2019 1:41 am

thx for reply
i modified the two occurrences in that file, since i modified all gl_linear that i could find in all the files
but still only 2d elements, i'm guessing the tile generator, get's that point filtering look
the textures on 3d objects are still filtered
i have to mention i'm not a coder so maybe i'm doing something wrong
maybe Ian can give a second opinion
solitarius576
 
Posts: 39
Joined: Thu Oct 20, 2016 10:33 pm

Re: no texture filtering

Postby Bart » Mon Nov 11, 2019 1:45 am

I didn't read Texture.cpp carefully. It is already set to nearest filtering. Turns out Ian is performing texture sampling in the shader, probably to emulate Model 3's non-OpenGL-compatible edge clamping. The shaders are in R3DShaderTriangles.h and R3DShaderQuads.h (normal and quad rendering, respectively). The relevant function is called textureR3D(). I'm not sure if Ian's engine supports the -frag-shader command line option to load external shaders but at the very least you can edit and recompile.
User avatar
Bart
Site Admin
 
Posts: 3086
Joined: Thu Sep 01, 2011 2:13 pm
Location: Reno, Nevada

Re: no texture filtering

Postby solitarius576 » Mon Nov 11, 2019 2:44 am

ah ok
thx again, i will try but as i said i'm no coder, and this shader business it's above me :oops:
solitarius576
 
Posts: 39
Joined: Thu Oct 20, 2016 10:33 pm

Re: no texture filtering

Postby solitarius576 » Fri Jan 17, 2020 1:19 am

i figured out and disabled the mipmaping too
everyhing is super sharp now
thx for the help
solitarius576
 
Posts: 39
Joined: Thu Oct 20, 2016 10:33 pm


Return to The Dark Room

Who is online

Users browsing this forum: No registered users and 0 guests

cron