Quantcast

Jump to content

» «
Photo

GTA V Dithering and Stripple Research and Fix

32 replies to this topic
Braindawg
  • Braindawg

    Carbon based Buffoon!!

  • The Yardies
  • Joined: 19 Jun 2008
  • None
  • Best Total Overhaul 2016 [Shine o' Vice]

#1

Posted 27 March 2016 - 08:10 PM Edited by Braindawg, 27 March 2016 - 09:21 PM.

"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-gen.../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:

Spoiler

 

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:

 

Spoiler

 

DOWNLOAD:

http://www.gtagarage...how.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!

  • George Costanza and CartmanKusanagi like this

_CP_
  • _CP_

    Boss

  • Feroci
  • Joined: 27 Dec 2007
  • Poland
  • Best Vehicle 2017 [IVPack]
    Most Helpful Modding 2016 [Runner-up]
    Best Vehicle 2016 [IVPack]
    Best Map 2013 "ViceCityStories PC Edition"

#2

Posted 28 March 2016 - 09:32 AM

Path is: GTA5.exe

Braindawg
  • Braindawg

    Carbon based Buffoon!!

  • The Yardies
  • Joined: 19 Jun 2008
  • None
  • Best Total Overhaul 2016 [Shine o' Vice]

#3

Posted 29 March 2016 - 02:11 PM Edited by Braindawg, 29 March 2016 - 02:13 PM.

Umm, care to elaborate?


_CP_
  • _CP_

    Boss

  • Feroci
  • Joined: 27 Dec 2007
  • Poland
  • Best Vehicle 2017 [IVPack]
    Most Helpful Modding 2016 [Runner-up]
    Best Vehicle 2016 [IVPack]
    Best Map 2013 "ViceCityStories PC Edition"

#4

Posted 29 March 2016 - 03:39 PM

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

Mr.Arrow
  • Mr.Arrow

    God Save the Penis

  • Members
  • Joined: 08 Nov 2011
  • United-Kingdom

#5

Posted 29 March 2016 - 04:51 PM Edited by Mr.Arrow, 29 March 2016 - 04:53 PM.

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.

Braindawg
  • Braindawg

    Carbon based Buffoon!!

  • The Yardies
  • Joined: 19 Jun 2008
  • None
  • Best Total Overhaul 2016 [Shine o' Vice]

#6

Posted 29 March 2016 - 05:07 PM

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?


_CP_
  • _CP_

    Boss

  • Feroci
  • Joined: 27 Dec 2007
  • Poland
  • Best Vehicle 2017 [IVPack]
    Most Helpful Modding 2016 [Runner-up]
    Best Vehicle 2016 [IVPack]
    Best Map 2013 "ViceCityStories PC Edition"

#7

Posted 29 March 2016 - 05:48 PM

Ask Alexander Blade or NTAuthority, they are more knowledgeable.

  • BlackScout likes this

Braindawg
  • Braindawg

    Carbon based Buffoon!!

  • The Yardies
  • Joined: 19 Jun 2008
  • None
  • Best Total Overhaul 2016 [Shine o' Vice]

#8

Posted 29 March 2016 - 06:17 PM Edited by Braindawg, 29 March 2016 - 06:18 PM.

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.


_CP_
  • _CP_

    Boss

  • Feroci
  • Joined: 27 Dec 2007
  • Poland
  • Best Vehicle 2017 [IVPack]
    Most Helpful Modding 2016 [Runner-up]
    Best Vehicle 2016 [IVPack]
    Best Map 2013 "ViceCityStories PC Edition"

#9

Posted 29 March 2016 - 06:37 PM

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


Braindawg
  • Braindawg

    Carbon based Buffoon!!

  • The Yardies
  • Joined: 19 Jun 2008
  • None
  • Best Total Overhaul 2016 [Shine o' Vice]

#10

Posted 31 March 2016 - 08:50 PM Edited by Braindawg, 31 March 2016 - 08:53 PM.

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.


BlackScout
  • BlackScout

    Group Therapy

  • Members
  • Joined: 08 Sep 2013
  • None

#11

Posted 09 April 2016 - 11:13 PM

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.

  • Mega and CartmanKusanagi like this

Spider-Vice
  • Spider-Vice

    Do androids dream of electric sheep?

  • Moderator
  • Joined: 09 Oct 2006
  • Portugal
  • Best Contributor in Rockstar Games 2017
    Best Newsletter 2017 [GTAF Weekly]
    Contribution Award [GTAF Weekly]
    Best Poster [Rockstar Games] 2016
    Contribution Award [GTA V]

#12

Posted 09 April 2016 - 11:38 PM

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


Braindawg
  • Braindawg

    Carbon based Buffoon!!

  • The Yardies
  • Joined: 19 Jun 2008
  • None
  • Best Total Overhaul 2016 [Shine o' Vice]

#13

Posted 10 April 2016 - 04:20 AM Edited by Braindawg, 10 April 2016 - 04:23 AM.

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.


_CP_
  • _CP_

    Boss

  • Feroci
  • Joined: 27 Dec 2007
  • Poland
  • Best Vehicle 2017 [IVPack]
    Most Helpful Modding 2016 [Runner-up]
    Best Vehicle 2016 [IVPack]
    Best Map 2013 "ViceCityStories PC Edition"

#14

Posted 10 April 2016 - 07:31 AM

txstipple is copied several times in texture archives, it's related to fur grass.
  • Spider-Vice, CartmanKusanagi and BlackScout like this

Braindawg
  • Braindawg

    Carbon based Buffoon!!

  • The Yardies
  • Joined: 19 Jun 2008
  • None
  • Best Total Overhaul 2016 [Shine o' Vice]

#15

Posted 10 April 2016 - 04:18 PM

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


_CP_
  • _CP_

    Boss

  • Feroci
  • Joined: 27 Dec 2007
  • Poland
  • Best Vehicle 2017 [IVPack]
    Most Helpful Modding 2016 [Runner-up]
    Best Vehicle 2016 [IVPack]
    Best Map 2013 "ViceCityStories PC Edition"

#16

Posted 10 April 2016 - 09:21 PM Edited by _CP_, 10 April 2016 - 09:24 PM.

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


Braindawg
  • Braindawg

    Carbon based Buffoon!!

  • The Yardies
  • Joined: 19 Jun 2008
  • None
  • Best Total Overhaul 2016 [Shine o' Vice]

#17

Posted 11 April 2016 - 07:16 PM Edited by Braindawg, 11 April 2016 - 07:32 PM.

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...


_CP_
  • _CP_

    Boss

  • Feroci
  • Joined: 27 Dec 2007
  • Poland
  • Best Vehicle 2017 [IVPack]
    Most Helpful Modding 2016 [Runner-up]
    Best Vehicle 2016 [IVPack]
    Best Map 2013 "ViceCityStories PC Edition"

#18

Posted 12 April 2016 - 09:30 AM

Works on fur grass:
LEOGOGlh.jpg

  • George Costanza, CartmanKusanagi, BlackScout and 1 other like this

AHK1221
  • AHK1221

    Is it that time already?

  • Members
  • Joined: 19 Dec 2015
  • Pakistan

#19

Posted 12 April 2016 - 03:08 PM

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


AHK1221
  • AHK1221

    Is it that time already?

  • Members
  • Joined: 19 Dec 2015
  • Pakistan

#20

Posted 12 April 2016 - 03:13 PM

 

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


_CP_
  • _CP_

    Boss

  • Feroci
  • Joined: 27 Dec 2007
  • Poland
  • Best Vehicle 2017 [IVPack]
    Most Helpful Modding 2016 [Runner-up]
    Best Vehicle 2016 [IVPack]
    Best Map 2013 "ViceCityStories PC Edition"

#21

Posted 12 April 2016 - 08:24 PM

v4YbXadh.png
lPetMLYh.png

  • Braindawg, George Costanza, Claude_Lib and 1 other like this

BlackScout
  • BlackScout

    Group Therapy

  • Members
  • Joined: 08 Sep 2013
  • None

#22

Posted 12 April 2016 - 08:41 PM

Whoa :D, awesome, it's something!


Claude_Lib
  • Claude_Lib

    Talkative like never before

  • Members
  • Joined: 26 Jun 2009
  • Russia

#23

Posted 13 April 2016 - 04:23 AM

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


_CP_
  • _CP_

    Boss

  • Feroci
  • Joined: 27 Dec 2007
  • Poland
  • Best Vehicle 2017 [IVPack]
    Most Helpful Modding 2016 [Runner-up]
    Best Vehicle 2016 [IVPack]
    Best Map 2013 "ViceCityStories PC Edition"

#24

Posted 13 April 2016 - 09:53 AM

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

BlackScout
  • BlackScout

    Group Therapy

  • Members
  • Joined: 08 Sep 2013
  • None

#25

Posted 13 April 2016 - 04:27 PM

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


Braindawg
  • Braindawg

    Carbon based Buffoon!!

  • The Yardies
  • Joined: 19 Jun 2008
  • None
  • Best Total Overhaul 2016 [Shine o' Vice]

#26

Posted 14 April 2016 - 08:44 PM

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


_CP_
  • _CP_

    Boss

  • Feroci
  • Joined: 27 Dec 2007
  • Poland
  • Best Vehicle 2017 [IVPack]
    Most Helpful Modding 2016 [Runner-up]
    Best Vehicle 2016 [IVPack]
    Best Map 2013 "ViceCityStories PC Edition"

#27

Posted 22 April 2016 - 09:43 PM Edited by _CP_, 23 April 2016 - 11:34 AM.

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

  • George Costanza and BlackScout like this

BlackScout
  • BlackScout

    Group Therapy

  • Members
  • Joined: 08 Sep 2013
  • None

#28

Posted 05 January 2017 - 08:09 AM

I think they use something related to that:

https://en.wikipedia...ki/Perlin_noise

Unsure, I was just lurking around strings and found this next to dither sh*t


BlackScout
  • BlackScout

    Group Therapy

  • Members
  • Joined: 08 Sep 2013
  • None

#29

Posted 4 weeks ago Edited by BlackScout, 3 weeks ago.

Bump. Double-Post needed.
 

Spoiler

 
Achieved thanks to Codewalker and robi29's code posted on http://gtaforums.com...entry1070057834
 
And also the graphical study made by Adrian Courrèges: http://www.adriancou...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.5
lt 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.x
lt r1.x, r1.x, l(1.000000)
lt r1.y, r0.w, l(0.250000)

Spoiler


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.x
lt 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.

  • Androll, George Costanza, robi29 and 5 others like this

robi29
  • robi29

    VisualV creator

  • Members
  • Joined: 20 Jun 2009
  • Poland

#30

Posted 3 weeks ago

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





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users