Shader Fails & How To Solve Them

User avatar
x Lethian x
GIANTS Software | QA Lead
Posts: 2179
Joined: Thu Mar 02, 2017 12:39 pm

Shader Fails & How To Solve Them

Post by x Lethian x » Fri Jan 25, 2019 12:18 pm

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 -> German / English | How to post a log file | How to upload images

User avatar
Rahkiin
GIANTS Software | Gameplay Programmer
Posts: 733
Joined: Tue Jan 17, 2017 12:45 pm

Re: Shader Fails & How To Solve Them

Post by Rahkiin » Fri Jan 25, 2019 3:58 pm

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 » Sun Jan 27, 2019 2:52 am

Thank you for taking the time to share this with us, it really helps.

joshv
Posts: 1
Joined: Mon Mar 04, 2019 5:09 am

Re: Shader Fails & How To Solve Them

Post by joshv » Mon Mar 04, 2019 5:13 am

Shaders are pieces of software that run on your graphics card.
spanish dictionary
Last edited by joshv on Thu Aug 22, 2019 4:04 am, edited 1 time in total.

User avatar
Vanquish081
Posts: 212
Joined: Wed Apr 19, 2017 10:29 am

Re: Shader Fails & How To Solve Them

Post by Vanquish081 » Sat Mar 16, 2019 1:44 am

Why no you include the script in GE?¿

smithclarkson01
Posts: 1
Joined: Thu Apr 11, 2019 1:40 pm

Re: Shader Fails & How To Solve Them

Post by smithclarkson01 » Thu Apr 11, 2019 1:43 pm

Thank you so much for sharing this info with us. I really helped me out figure out a lot of things!

User avatar
Farming Girl
Posts: 285
Joined: Thu Aug 02, 2018 12:42 pm

Re: Shader Fails & How To Solve Them

Post by Farming Girl » Sat Apr 13, 2019 12:59 pm

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
GIANTS Software | Gameplay Programmer
Posts: 733
Joined: Tue Jan 17, 2017 12:45 pm

Re: Shader Fails & How To Solve Them

Post by Rahkiin » Sat Jul 20, 2019 2:40 pm

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 » 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. shareit apk
Last edited by scottsen11 on Wed Aug 07, 2019 11:00 am, edited 1 time in total.

User avatar
Rahkiin
GIANTS Software | Gameplay Programmer
Posts: 733
Joined: Tue Jan 17, 2017 12:45 pm

Re: Shader Fails & How To Solve Them

Post by Rahkiin » Mon Aug 05, 2019 11:16 am

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: 430
Joined: Sun Aug 28, 2016 12:21 am
Location: Sweden

Re: Shader Fails & How To Solve Them

Post by asyvan » Fri Aug 09, 2019 9:46 pm

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)
Using Logitech G29, Logitech/Saitek Sidepanel, Logitech F710 Wireless gamepad (Forestry/Logging)
PC Gamer - "The Silent Beast" i7-7700K @ 5Ghz, GTX 1070 @ 2.1GHz

My published ModHub mod: Case IH Puma CVX With Tracks

roymerr
Posts: 1
Joined: Mon Aug 26, 2019 7:50 am

Re: Shader Fails & How To Solve Them

Post by roymerr » Mon Aug 26, 2019 7:53 am

Nice to see this here. Thanks for sharing this to us. Keep sharing the new things like this.

Post Reply