Shader Fails & How To Solve Them

Your forum for all discussions around Modding.
User avatar
x Lethian x
Former GIANTS employee
Posts: 2190
Joined: Thu Mar 02, 2017 12:39 pm

Shader Fails & How To Solve Them

Post by x Lethian x »

Hi guys and gals, Lethian here.

Today we want to bring you a quick update on how to solve any shader fails you might get from our ModHub tests.

Some of you might be asking: What are shader fails? Well, we have a smart little script on our end we use for mod testing to see what problems a mod might have on consoles. It tells us which shader and material are causing the issue and what elements might be wrong or are missing from it in order to display the mod correctly inGame. These fails might look something like this (if not taken care of) inGame:

Image

The amount of fails on single tool or vehicle mods might be small but on maps there might be a lot since they often use lots of custom objects and edits. The report you will receive from our ModHub team after testing will look something like this:
------------------------------------------------------------------------------------------------------------------------------

Custom shader: data/shaders/treeBillboardShader.xml
Material attributes 3E3EABBA-00002615
- MASK_ALPHA_BLENDING
- MASK_ALBEDOMAP
- NORMAL_MAP_FORMAT 3CHANNEL
- MASK_ALLOW_FOG
- MASK_LIGHTING
- MASK_USED
- Custom material id 3E3EABBA
LightEnvShape attributes 00000000-B0000000
- use shadow map: no
- GPU perf class 2
- Large shadow map filter
- Non-MSAA

Nearest hash 3E3EABBA.00002616-00000000.B0000000.
Material attributes 3E3EABBA-00002616
- MASK_ALPHA_TESTING
- MASK_ALBEDOMAP
- NORMAL_MAP_FORMAT 3CHANNEL
- MASK_ALLOW_FOG
- MASK_LIGHTING
- MASK_USED
- Custom material id 3E3EABBA
LightEnvShape attributes 00000000-B0000000
- use shadow map: no
- GPU perf class 2
- Large shadow map filter
- Non-MSAA

FAIL (Material maple5LOD_mat, Hash 3E3EABBA.00002615-00000000.B0000000)

------------------------------------------------------------------------------------------------------------------------------
The above example shows entries for ONE shader fail only, respectively per material. Some mods come with a few, others come with hundreds. To communicate these fails we will only send you a bulk of them if there simply are too many. If you want to receive the full list of fails, feel free to open up a ticket in our ModHub Messenger anytime and provide your eMail address - we can then send you a .txt file including all the shader/material fails.


Now, to solve these fails, check out the color codes down below - a shader fail report is split into two parts, the first one listing the material and all its current elements and the second part showing the elements it should have assigned for it to work properly on console. You need to spot the difference between both to determine the problem:
------------------------------------------------------------------------------------------------------------------------------

Custom shader: data/shaders/treeBillboardShader.xml <- The specific shader having the problem, sometimes the material used needs another shader altogether.
Material attributes 3E3EABBA-00002615
- MASK_ALPHA_BLENDING <- Elements that are incorrect and not present in the list below are most likely causing the fail.
- MASK_ALBEDOMAP
- NORMAL_MAP_FORMAT 3CHANNEL
- MASK_ALLOW_FOG
- MASK_LIGHTING
- MASK_USED
- Custom material id 3E3EABBA
LightEnvShape attributes 00000000-B0000000
- use shadow map: no
- GPU perf class 2
- Large shadow map filter
- Non-MSAA

Nearest hash 3E3EABBA.00002616-00000000.B0000000.
Material attributes 3E3EABBA-00002616
- MASK_ALPHA_TESTING <- Elements that are missing from the list above and need to be included/exchanged with the faulty ones to remove the fail.
- MASK_ALBEDOMAP
- NORMAL_MAP_FORMAT 3CHANNEL
- MASK_ALLOW_FOG
- MASK_LIGHTING
- MASK_USED
- Custom material id 3E3EABBA
LightEnvShape attributes 00000000-B0000000
- use shadow map: no
- GPU perf class 2
- Large shadow map filter
- Non-MSAA

FAIL (Material maple5LOD_mat, Hash 3E3EABBA.00002615-00000000.B0000000) <- This is the material name you need to search for in your .i3d file - make sure it has the proper elements assigned to remove the shader fail.

So, the correct elements in this case would look something like this:

Custom shader: data/shaders/treeBillboardShader.xml
Material attributes 3E3EABBA-00002615
- MASK_ALPHA_TESTING
- MASK_ALBEDOMAP
- NORMAL_MAP_FORMAT 3CHANNEL
- MASK_ALLOW_FOG
- MASK_LIGHTING
- MASK_USED
- Custom material id 3E3EABBA
LightEnvShape attributes 00000000-B0000000
- use shadow map: no
- GPU perf class 2
- Large shadow map filter
- Non-MSAA


------------------------------------------------------------------------------------------------------------------------------
Once the changes have been made to the material and its elements causing the shader fail, you should resubmit and we will check if the issue was resolved.

Hopefully this will clear some things up for you modders out there and make your life easier when bringing your mod to consoles! :wink3:
How to report a BUG | How to post a log file | How to upload images
User avatar
Rahkiin
Former GIANTS employee
Posts: 753
Joined: Tue Jan 17, 2017 12:45 pm

Re: Shader Fails & How To Solve Them

Post by Rahkiin »

A little background detail for why this all is an issue on consoles and not on PC:

Shaders are pieces of software that run on your graphics card. Most games that run on PC just supply the source code (the shader.xml files in our case) and then they are compiled (turned into programs) when the game starts or when the shader is needed. Import here is that the shader needs to be build for every variation. Variations are both shader configurations (customShaderVariation) but also which textures you use, and in what format the textures are. For example, one house that has a DXT5 texture and another house with a DXT1 texture are 2 different compilations because of the alpha channel. (This is also why you need to use the correct format!)

Now this is not an issue on PC. On console, we are not allowed to compile shaders (or scripts for that matter. Anything, really) so we build them when we release the game and then put the programs in the game. This means, however, that any configuration that is not used in the game, can't be used by a mod either. because it is simply not available. If it is not available, it won't be rendered and you have these big gaps in your mod or map, as you see in the post above.
Our shader checker looks into the combinations used in your mod, compares them to the combinations used in the game, and if it finds it: OK. If it doesn't: Shader Fail.

So make sure you use a known format. For example, you can't add an emissive map to the flags we used in the US map because that combination (flagShader, normal map, albedo and emissive) does not exist. To add a flag, look at the flag in the US or EU map, and its material format (it has a texture, normal map and a glossmap, in this case)

Hope this helps in the process of preventing these failures, and also help you understand why this happens at all.
Shivaa
Posts: 5
Joined: Thu Dec 27, 2018 5:56 pm

Re: Shader Fails & How To Solve Them

Post by Shivaa »

Thank you for taking the time to share this with us, it really helps.
User avatar
Vanquish081
Posts: 329
Joined: Wed Apr 19, 2017 10:29 am

Re: Shader Fails & How To Solve Them

Post by Vanquish081 »

Why no you include the script in GE?¿
User avatar
Farming Girl
Posts: 321
Joined: Thu Aug 02, 2018 12:42 pm

Re: Shader Fails & How To Solve Them

Post by Farming Girl »

Rahkiin wrote: Fri Jan 25, 2019 3:58 pm Our shader checker looks into the combinations used in your mod, compares them to the combinations used in the game, and if it finds it: OK. If it doesn't: Shader Fail.
Is there any software that i can get that would check this before submitting? or is it too expensive for a private individual?
Ann-Marie

C&S Modding
User avatar
Rahkiin
Former GIANTS employee
Posts: 753
Joined: Tue Jan 17, 2017 12:45 pm

Re: Shader Fails & How To Solve Them

Post by Rahkiin »

It only exists internally.
scottsen11
Posts: 1
Joined: Sun Aug 04, 2019 11:22 am

Re: Shader Fails & How To Solve Them

Post by scottsen11 »

I am at a total loss trying to write a very simple shader to output information on a voronoi diagram algorithm I've been toying with. It's supposed to take 2 values (a biom and an elevation), colorize the fragment as determined by the biom# and brighten it by 1/10th the elevation. VERY simple shader, and I could easily have done it in older GLSL versions but I've just migrated to openGL 4.0 and am having a hard time relearning GLSL.
Last edited by scottsen11 on Wed Aug 07, 2019 11:00 am, edited 1 time in total.
User avatar
Rahkiin
Former GIANTS employee
Posts: 753
Joined: Tue Jan 17, 2017 12:45 pm

Re: Shader Fails & How To Solve Them

Post by Rahkiin »

scottsen11 wrote: Sun Aug 04, 2019 11:25 am I am at a total loss trying to write a very simple shader to output information on a voronoi diagram algorithm I've been toying with. It's supposed to take 2 values (a biom and an elevation), colorize the fragment as determined by the biom# and brighten it by 1/10th the elevation. VERY simple shader, and I could easily have done it in older GLSL versions but I've just migrated to openGL 4.0 and am having a hard time relearning GLSL.
This forum and post is really about shader issues inside Farming simulator, not generic shader programming.

However: maybe try a lerp between the biome color and white using the elevation? In a pixel shader, of course.
lerp(biomeColor, white, (elevation/maxElevation)/10)
User avatar
asyvan
Posts: 549
Joined: Sun Aug 28, 2016 12:21 am
Location: Sweden

Re: Shader Fails & How To Solve Them

Post by asyvan »

Rahkiin wrote: Fri Jan 25, 2019 3:58 pm So make sure you use a known format. For example, you can't add an emissive map to the flags we used in the US map because that combination (flagShader, normal map, albedo and emissive) does not exist. To add a flag, look at the flag in the US or EU map, and its material format (it has a texture, normal map and a glossmap, in this case)
This helped me to understand why this matters on Console. But it would be extremely helpful it there were a list of these known combinations. I just fixed shader fails on my mod after comments from Modhub, but if I had known in advance I could have fixed it before.
//Jens Ejvinsson
Farming History: FS11, FS13, FS15, FS17, FS19 (Steam)
Logitech G29, Logitech/Saitek Sidepanel, Logitech F710 Wireless gamepad
PC Gamer - "The Silent Beast" i7-7700K @ 5Ghz, GTX 1070 @ 2.1GHz

Case IH Puma CVX With Tracks
Väderstad Rapid A600-800S Seed Drill
Tutorial compilation for FS19 - list of all my How To guides
roymerr
Posts: 1
Joined: Mon Aug 26, 2019 7:50 am

Re: Shader Fails & How To Solve Them

Post by roymerr »

Nice to see this here. Thanks for sharing this to us. Keep sharing the new things like this.
User avatar
sbtfan
Posts: 9
Joined: Thu Jul 05, 2018 12:49 pm
Contact:

Re: Shader Fails & How To Solve Them

Post by sbtfan »

I have a shader fail that doesn't look anything like the above post. Could you help me understand what the issue is and how to fix it?
<missingShaders num="3">
<!--used shader is not present in the cache and therefore not available on consoles-->
<missingCustomShader>
<shader file="data/shaders/groundHeightShader.xml" variation="None"/>
<details>
i3dFiles
<details>
i3dFile: C:/Users/xxx/Downloads/FS19_BucksCounty/maps/mapUS.i3d
<material name="groundDetailHeight_mat" id="0"/>
</details>
</details>
</missingCustomShader>
<missingCustomShader>
<shader file="data/shaders/groundHeightShader.xml" variation="None"/>
<details>
i3dFiles
<details>
i3dFile: C:/Users/xxx/Downloads/FS19_BucksCounty/maps/mapUS.i3d
<material name="groundDetailHeight_mat" id="0"/>
</details>
</details>
</missingCustomShader>
<missingCustomShader>
<shader file="data/shaders/groundHeightShader.xml" variation="None"/>
<details>
i3dFiles
<details>
i3dFile: C:/Users/xxx/Downloads/FS19_BucksCounty/maps/mapUS.i3d
<material name="groundDetailHeight_mat" id="0"/>
</details>
</details>
</missingCustomShader>
</missingShaders>
kirsh719
Posts: 3
Joined: Sat Jan 08, 2022 3:54 am

Re: Shader Fails & How To Solve Them

Post by kirsh719 »

Not sure if this is related to this topic but I'm experiencing something very annoying in my games. Some of the headers that attach to combines and forage harvester don't stay put when attached. Its like there is a center pivot when its attached and moves so much while attached to the combine and forage harvester. I have tried to eliminate different script mods but am having no luck. Its really annoying driving a forage harvester with an earlage converted head and it swaying and moving all over the place. Please help. Thank you.
Post Reply