Jump to content
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. Los Santos Drug Wars
      2. Updates
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

      1. Blood Money
      2. Frontier Pursuits
      3. Find Lobbies & Outlaws
      4. Help & Support
    3. Crews

    1. Grand Theft Auto Series

      1. Bugs*
      2. St. Andrews Cathedral
    2. GTA VI

    3. GTA V

      1. Guides & Strategies
      2. Help & Support
    4. GTA IV

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. GTA San Andreas

      1. Classic GTA SA
      2. Guides & Strategies
      3. Help & Support
    6. GTA Vice City

      1. Classic GTA VC
      2. Guides & Strategies
      3. Help & Support
    7. GTA III

      1. Classic GTA III
      2. Guides & Strategies
      3. Help & Support
    8. Portable Games

      1. GTA Chinatown Wars
      2. GTA Vice City Stories
      3. GTA Liberty City Stories
    9. Top-Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

      1. Documentation
    3. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    4. Featured Mods

      1. Design Your Own Mission
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Movies & TV
      5. Music
      6. Sports
      7. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. Announcements

    2. Forum Support

    3. Suggestions

Сustom shader blend using two layered masks for GTA IV, by Chips


MIXAZZZ
 Share

Recommended Posts

Hi guys. Today I'll tell you how to use a home-made shader written Chipsman, to mix 6 layers of texture to 2 masks.

 

-----------------------------------------------------------

 

First you need to:

take the file preload.list from the archive and put it in the directory

<Grand Theft Auto IV>\common\shaders, replace confirm (and make backup before)

 

Then, in each of its subfolders put the file rdr2like_terrain.fxc.

 

At this stage, all the components of the shader set in GTA IV.

--------------

Next we need to get into the directory with installed OpenIV

Sample: C:\Users\%USERNAME%\AppData\Local\New Technology Studio\Apps\OpenIV\Games\IV\openFormats

 

Open into notepad ShaderManager.xml, and paste to end, before </ShaderManager> next text.

 

	</shader>	<shader key="rdr2like_terrain.sps">		<index>86</index>		<name>rdr2like_terrain</name>		<vertexFormat>0x4059</vertexFormat>		<drawBucket>0</drawBucket>		<effectSize>440</effectSize>		<skinned>False</skinned>		<params>			<item type="spVector4" name="luminanceconstants" custom="False">0.21250000;0.71540000;0.07210000;0.00000000</item>			<item type="spVector4" name="materialdiffuse" custom="False">1.00000000;1.00000000;1.00000000;1.00000000</item>			<item type="spTexture" name="TerrainDiffuseSampler1" custom="True"/>			<item type="spTexture" name="TerrainDiffuseSampler2" custom="True"/>			<item type="spTexture" name="TerrainDiffuseSampler3" custom="True"/>			<item type="spTexture" name="TerrainDiffuseSampler4" custom="True"/>			<item type="spTexture" name="TerrainDiffuseSampler5" custom="True"/>			<item type="spTexture" name="TerrainDiffuseSampler6" custom="True"/>			<item type="spTexture" name="TerrainBlendMap1" custom="True"/>			<item type="spTexture" name="TerrainBlendMap2" custom="True"/>			<item type="spTexture" name="TerrainNormalSampler1" custom="True"/>			<item type="spTexture" name="TerrainNormalSampler2" custom="True"/>			<item type="spTexture" name="TerrainNormalSampler3" custom="True"/>			<item type="spTexture" name="TerrainNormalSampler4" custom="True"/>			<item type="spTexture" name="TerrainNormalSampler5" custom="True"/>			<item type="spTexture" name="TerrainNormalSampler6" custom="True"/>			<item type="spVector4" name="MegaTileRepetitions" custom="True"/>			<item type="spVector4" name="MegaTileOffset" custom="True"/>			<item type="spVector4" name="BlendMapScale1" custom="True"/>			<item type="spVector4" name="BlendMapOffset1" custom="True"/>			<item type="spVector4" name="BlendMapScale2" custom="True"/>			<item type="spVector4" name="BlendMapOffset2" custom="True"/>			<item type="spVector4" name="Bumpiness_Terrain123" custom="True"/>			<item type="spVector4" name="Bumpiness_Terrain456" custom="True"/>		</params>	</shader>
These data can also be copied from the file ShaderManager.xml , which is in the archive. But I strongly not advise you to copy the file because it is an older version.

 

Shader params:

TerrainDiffuseSampler1 - diffuse texture of layer 1

TerrainDiffuseSampler2 - diffuse texture of layer 2

TerrainDiffuseSampler3 - diffuse texture of layer 3

TerrainDiffuseSampler4 - diffuse texture of layer 4

TerrainDiffuseSampler5 - diffuse texture of layer 5

TerrainDiffuseSampler6 - diffuse texture of layer 6

TerrainBlendMap1 - mask for layer 1-3

TerrainBlendMap2 - mask for layer 4-6

TerrainNormalSampler1 - normal map texture of layer 1

TerrainNormalSampler2 - normal map texture of layer 2

TerrainNormalSampler3 - normal map texture of layer 3

TerrainNormalSampler4 - normal map texture of layer 4

TerrainNormalSampler5 - normal map texture of layer 5

TerrainNormalSampler6 - normal map texture of layer 6

MegaTileRepetitions - UV Tile

MegaTileOffset - UV Tile Offset

BlendMapScale1 - The thickness of the transition between the layers blend, for layer 1-3

BlendMapOffset1 - ?

BlendMapScale2 - The thickness of the transition between the layers blend, for layer 5-6

BlendMapOffset2 - ?

Bumpiness_Terrain123 - bump power for layer 1-3

Bumpiness_Terrain456 - bump power for layer 4-6

 

Since no GIMS no OFIO does not support this shader to export from 3dsmax, then use for export models the shader gta_default.

Then, change the text in Notepad gta_default on new shader.

 

Sample data for my test model:

 

	Shaders 1	{		rdr2like_terrain.sps LOW_l1_dno LOW_l2_skala1 LOW_l3_skala2 LOW_l4_grass LOW_l5_gravel LOW_l6_grass2 custom_mask1 custom_mask2 LOW_l1_dno_n LOW_l2_skala1_n LOW_l3_skala2_n LOW_l4_grass_n LOW_l5_gravel_n LOW_l6_grass2_n 80.0;80.0;0.0;0.0 0.0;0.0;0.0;0.0 1.0;1.0;0.0;0.0 0.0;0.0;0.0;0.0 1.0;1.0;0.0;0.0 0.0;0.0;0.0;0.0 0.5;0.5;0.5;0.0 0.5;0.5;0.5;0.0	}
Now that your OpenIV can read this shader, simply import .ODR your file and use it as a normal model of the map.

--------------

Now I will tell you about the masks and the principle of mixing. First, consider the original texture of the terrain RDR.

 

The top row - the texture of the order.

Bottom row - normal map for them.

25oRp.png 25oRr.png 25oRt.png 25oRv.png 25oRx.png 25oRn.png

25oRo.png 25oRq.png 25oRs.png 25oRu.png 25oRw.png 25oRm.png

 

And of course the two masks that define the mix. (3 mask in one picture for layers 1-3, and 3 mask in the second image for the layers 4-6)

25oRj.png 25oRk.png

 

Mask layers are arranged in this order.

 

 

МАСКА 1:#R слой 1#G слой 2#B слой 3МАСКА 2:#R слой 1#G слой 2#B слой 3
Open the Photoshop mask and watch the channel data to understand what works.

 

Now back to my tests, I had a total of 4 layers, so my textures look so.

 

25oRV.jpg

 

My params for test model.

 

	Shaders 1	{		rdr2like_terrain.sps LOW_l1_dno LOW_l2_skala1 LOW_l3_skala2 LOW_l4_grass LOW_l5_gravel LOW_l6_grass2 custom_mask1 custom_mask2 LOW_l1_dno_n LOW_l2_skala1_n LOW_l3_skala2_n LOW_l4_grass_n LOW_l5_gravel_n LOW_l6_grass2_n 80.0;80.0;0.0;0.0 0.0;0.0;0.0;0.0 1.0;1.0;0.0;0.0 0.0;0.0;0.0;0.0 1.0;1.0;0.0;0.0 0.0;0.0;0.0;0.0 0.5;0.5;0.5;0.0 0.5;0.5;0.5;0.0	}
It was the first test, and he did not look particularly impressionable.

 

http://www.youtube.com/watch?v=16QO-zfjyBQ

 

Later I made a more interesting map location with this shader, which event used in one version of fashion Criminal Russia Rage.

 

http://www.youtube.com/watch?v=eNAgv6tHp3o and this

 

----------------- EPILOGUE -----------------

 

I hope you use this technology for creating amazing project for GTA IV.

Edited by MIXAZZZ


CPU: i7 4790\ MEM: 32GB ram \ GPU: NVIDIA GeForce RTX 2060 SUPER 8GB Vram \ OS: Win7 x64

Link to comment
Share on other sites

The RDR port will use this that's for sure. And might work on V too if the shader gets loaded.

  • Like 2
Link to comment
Share on other sites

  • 8 months later...
  • 3 years later...

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
 Share

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