Jump to content

GTA V Dithering and Stripple Research and Fix


Braindawg

Recommended Posts

"Dithering is a technique to increase the amount of color and shading that can be done on a system. The effect is achieved by using lines or dots which are then blurred by the video encoders that the system uses."

 

 

 

 

 

-From Emulation General Wiki

http://emulation-general.wikia.com/wiki/Dithering

 

UPiJa.jpg

 

sqHEB.png

 

In GTA IV, GTA V, (Possibly even Red Dead Redemption and Max Payne 3)

 

Rockstar uses dithering to "cover up" LOD (Low on detail) pop ins.

The normal model is only drawn from up close, if you're far enough, the lower detail models will start replacing the normal model, until it completely dissapears.

 

THE DITHERING EFFECT apparently "helps" cover up the transition of these models being drawn. Dithering is also used in edges of transparent textures.

 

GTA IV:

 

Pretty much any texture with an alpha(transparency channel)

That includes:

 

Hair

Chain link fences

Trees

Bushes

Nets

LOD Models for props

Peds appear to pop in without any dithering

 

GTA V:

Hair and beards

Online chains

Earrings

Some shrubbery

LOD models over all.

Some transparent textures

 

Expert photoshop example (Will post screenshots and videos eventually)

ec0cfc2c8e74fa6b7d7a9b3dfcd27873.png

 

Ingame examples:

 

 

04_diffuse_checkerboard_legend.jpg

 

C4Awzle.png

 

 

 

GTA V just seems to be a graphical mystery because this effect doesn't always appear. The transition either appears to be smooth and unnoticed, or horribly pixelated and distracting.

It reminds me of FXAA to an extent, it seems to work on some parts of the screen, but some edges still seem a bit jagged.

 

IN THEORY:

The dithering effect is just a texture like in GTA IV, that can be found and replaces with a smoother one.

 

Check out this good example by DexX for GTA IV:

 

 

 

image_9698.jpg

 

 

 

DOWNLOAD:

http://www.gtagarage.com/mods/show.php?id=5721

 

I am sad to say I've spent about 5 hours looking through the GTA V files and I am sad to say that the dithering or stipple effect adapted from GTA IV is present in the game, and is not complicated to get rid of, if it works the same way it does in GTA IV, and it most likely does.

 

The file is located in GTA IV/PC/Textures in GTA IV, however I cannot find the file anywhere within the GTA V archives!

 

The dither effect does NOT change after altering the following files:

 

x64a.rpf/textures/:

 

depdensity.ytd -> all textures

graphics.ytd -> shadowdither

skydome.ytd -> dither

 

And is most likely not located within that archive.

I've been searching through everything else with no luck. If anyone else finds a file called:

 

dither, dithering, stripple, dith and so on...

 

please post the path!

Edited by Braindawg
  • Like 4
Link to comment
Share on other sites

Path is: GTA5.exe

Link to comment
Share on other sites

Umm, care to elaborate?

Edited by Braindawg
Link to comment
Share on other sites

Dither texture is embeeded in exexutable file, and we can't change it.

Link to comment
Share on other sites

Umm, care to elaborate?

It's hardcoded.You can't manipulate it if the thing is stored in exe.Unlike a data file,an executable file cannot be read because it has been compiled.

Edited by Mr.Arrow
Link to comment
Share on other sites

Dither texture is embeeded in exexutable file, and we can't change it.

I was actually hoping for an explanation on how you found that out, not doubting your knowlage condicering uve made one of my fave mods for GTAV but sh*t... Is there really nothing we can do?

Link to comment
Share on other sites

Ask Alexander Blade or NTAuthority, they are more knowledgeable.

  • Like 1
Link to comment
Share on other sites

wait so CAN you actually confirm it's embedded into the exe? or is it just speculation? Again you didn't rly explain on HOW YOU FOUND THAT OUT.

C++ expert coding language from NTA or Blade will sound like japanese to me.

Edited by Braindawg
Link to comment
Share on other sites

I didn't find any of dither textures related to LOD models, so it must be in EXE.

Link to comment
Share on other sites

Well guess again, because im certain Rockstar is lazy enough to keep the dithering effect somewhere. The COMMAND to dither the objects is there. But if we change the texture to a smoother one, it will remove the unwanted pixels and "grain". We must continue this research and find this texture or textures and change them to see the effect. If you want a good example, download DexX's IV example and play around with the file.

 

If the transition can't be smooth enough, we can at least disguise it enough for the game not to look pixely.

Edited by Braindawg
Link to comment
Share on other sites

  • 2 weeks later...
BS_BlackScout

I think I might have found the stipple texture used in V. *In the wrong place I guess*

AUJz3ai.png

It probably won't fix anything, looks more like a leftover and it's hidden in the middle of random sh*t.

  • Like 2
Link to comment
Share on other sites

Spider-Vice

That looks like it's for a specific texture, not for everything. it's a dithering pattern for that texture.

Link to comment
Share on other sites

AAAAAAAA where did you find that?! R* has a habit of leaving files "hidden" or "misplaced". Who knows? Editing this texture and checking if it changes anything is worth a try.

Edited by Braindawg
Link to comment
Share on other sites

txstipple is copied several times in texture archives, it's related to fur grass.

  • Like 3
Link to comment
Share on other sites

Can anyone post a few paths to locate copies of this file?

Link to comment
Share on other sites

x64i.rpf\levels\gta5\_citye\downtown_01\dt1_06.rpf\dt1_06_grnd.ytd
x64a.rpf\textures\plantsmgr.ytd

Edited by _CP_
Link to comment
Share on other sites

f*ckin hell the function has to be assigned to a texture like in IV, i'd be surprised, and disappointed if R* actually changed that Q_Q i must continue searching....

 

edited a few of those copies, nothing...

Edited by Braindawg
Link to comment
Share on other sites

Works on fur grass:
LEOGOGlh.jpg

  • Like 4
Link to comment
Share on other sites

I just want to say, LOD DOES NOT MEAN LOW ON DETAIL FOR GODS SAKE!!! It means level of detail......

Link to comment
Share on other sites

 

Umm, care to elaborate?

It's hardcoded.You can't manipulate it if the thing is stored in exe.Unlike a data file,an executable file cannot be read because it has been compiled.

 

Well, cracks do the same thing. You can decompile the file edit the texture and recompile it(in theory). It's clearly possible, a term for it called Reverse-engineering. but you'll get banned. Ask AB or NTA, those WILL know how to do it, if the file is really located in the .exe

Link to comment
Share on other sites

v4YbXadh.png
lPetMLYh.png

  • Like 4
Link to comment
Share on other sites

Wow, that's cool. How did you achieve that? Manually replacing every single stipple texture in the arcives, I guess?

Link to comment
Share on other sites

Michael's fur grass has stipple texture and fix works only here, we have to find all locations of stipple in texture archives.

Link to comment
Share on other sites

BS_BlackScout

Michael's fur grass has stipple texture and fix works only here, we have to find all locations of stipple in texture archives.

If only we had some way to find textures inside YTD's by searching them... :S

Link to comment
Share on other sites

So theyve made copies of one file to represent certain parts of the map or at least the grass on it? the f*ck... why not have one texture triggered for ALL pop in and alpha effects like in IV -_-

 

So... maybe there are appropriate stripple textures in charge of hair and maybe even lod models... might give up my weekend to go through the entire gta v file library LOL

Link to comment
Share on other sites

  • 2 weeks later...

x64g.rpf\levels\gta5\generic\gtxd.rpf\globalfurgrass.ytd

Of course it doesn't remove all problems with grass, but most of them should disappear.

Another txstipple references:
x64a.rpf\textures\plantsmgr.ytd
x64i.rpf\levels\gta5\_citye\downtown_01\dt1_06.rpf\dt1_06_grnd.ytd

x64k.rpf\levels\gta5\_citye\scentral_01\sc1_27.rpf\sc1_27_grnd.ytd
x64l.rpf\levels\gta5\_cityw\beverly_01\bh1_05.rpf\bh1_05.ytd
x64l.rpf\levels\gta5\_cityw\beverly_01\bh1_06.rpf\bh1_06.ytd
x64l.rpf\levels\gta5\_cityw\beverly_01\bh1_40.rpf\bh1_40_hotel.ytd
x64l.rpf\levels\gta5\_cityw\beverly_01\bh1_42b.rpf\bh1_42b_park.ytd
x64l.rpf\levels\gta5\_cityw\beverly_01\bh1_48.rpf\bh1_48.ytd
x64l.rpf\levels\gta5\_cityw\beverly_01\bh1_rd.rpf\bh1_rd2.ytd
x64l.rpf\levels\gta5\_cityw\airport_01\ap1_04.rpf\ap1_04_ground.ytd

x64m.rpf\levels\gta5\_cityw\santamon_01\sm_07.rpf\sm_07_grnd.ytd
x64m.rpf\levels\gta5\_cityw\santamon_01\sm_13.rpf\sm_13_grnd.ytd
\x64m.rpf\levels\gta5\_cityw\santamon_01\sm_17.rpf\sm_17ground.ytd

Edited by _CP_
  • Like 2
Link to comment
Share on other sites

  • 8 months later...
  • 1 year later...
BS_BlackScout

Bump. Double-Post needed.

PQTAjHV.png



Achieved thanks to Codewalker and robi29's code posted on http://gtaforums.com/topic/882840-codewalker-3d-map-viewer-for-gtav/page-8?do=findComment&comment=1070057834

And also the graphical study made by Adrian Courrèges: http://www.adriancourreges.com/blog/2015/11/02/gta-v-graphics-study/

@_CP_ You and robi29 should investigate default.fxc (and the other default shaders too) if you want to remove dithering.
Look for Subsample Alpha.

Try messing with:

dp2 r1.y, v0.xyxx, l(0.5, 0.5, 0.0, 0.0)  // Dot product of the pixel's (x,y) with (0.5, 0.5)frc r1.y, r1.y                            // Keeps only the fractional part: always 0.0 or 0.5lt r1.y, r1.y, l(0.5)                     // Test if the fractional part is smaller than 0.5

I changed all those 0.5s to 1.0 but to be fair I think it can be tweaked a little better.

Also, some of the tree shaders feature this bit of code. It's worth taking a look too.

UPDATE:

I have achieved better results changing some other stuff. As of now that snippet is more like:

dp2 r1.x, v0.xyxx, l(1.000000, 1.000000, 0.000000, 0.000000)frc r1.x, r1.xlt r1.x, r1.x, l(1.000000)lt r1.y, r0.w, l(0.250000)

 


4PHW25l.png



UPDATE2: Alternatively, there is another way that seems to yield better results and less issues.

dp2 r1.x, v0.xyxx, l(0.500000, 0.500000, 0.000000, 0.000000)frc r1.x, r1.xlt r1.x, r1.x, l(0.500000) // This value from what I've tested didn't do much.lt r1.y, r0.w, l(0.000000) // This value makes the biggest difference.

Compared to the previous one:
klOLaNt.png
I mean, it's looking like a f*cking cone. I don't know.

Edited by BlackScout
  • Like 9
Link to comment
Share on other sites

The result visible on the last screen on the left is very nice, but does not it break anti-aliasing?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.