How to make PBR Materials working with Iris Shaders - ModularMods/MCglTF GitHub Wiki

This is for everyone. Modder that used PBR materials and Normal map for glTF models, should inform their users to watch this tutorial.

Download and Install Iris Shaders with Sodium

https://irisshaders.net/

https://www.curseforge.com/minecraft/mc-mods/sodium

Run Minecraft and close it to make shaderpacks folder exist in your Game Dir.

Choose one of the shaderpack list below, and put downloaded shaderpack into shaderpacks folder.

BSL Shaders

https://bitslablab.com/bslshaders/

Preview

Most BSL based shaderpack will work properly with MCglTF.

https://bitslablab.com/bslshaders/#extras

Patch entity.properties

In this section, you need to use the Zip Archiver you familiar to fix entity.properties.

entity.properties is located at shaders of shaderpack zip file.

Extract entity.properties for editing as describe below with the desired text editor you prefered, and then put it back into the shaderpack zip file once finish.

Find this line

entity.10100=minecraft:item_frame minecraft:painting minecraft:glow_item_frame

Remove minecraft:item_frame and minecraft:glow_item_frame

entity.10100=minecraft:painting

What this patch done is preventing normal mapped model in the Item Frame have weird lighting result after Minecraft version 1.12.2.

Patch materialGbuffers.glsl

This issue had been fix since BSL v8.2. You don't need to apply this patch anymore.

In this section, you need to use the Zip Archiver you familiar to fix materialGbuffers.glsl.

materialGbuffers.glsl is located at shaders/lib/surface/ of shaderpack zip file.

Extract materialGbuffers.glsl for editing as describe below with the desired text editor you prefered, and then put it back into the shaderpack zip file once finish.

Replace this line

vec4 specularMap = texture2DGradARB(specular, newCoord, dcdx, dcdy);

With these line

#ifdef PARALLAX
vec4 specularMap = texture2DGradARB(specular, newCoord, dcdx, dcdy);
#else
vec4 specularMap = texture2D(specular, texCoord);
#endif

Replace this line

normalMap = texture2DGradARB(normals, newCoord, dcdx, dcdy).xyz * 2.0 - 1.0;

With these line

#ifdef PARALLAX
normalMap = texture2DGradARB(normals, newCoord, dcdx, dcdy).xyz * 2.0 - 1.0;
#else
normalMap = texture2D(normals, texCoord).xyz * 2.0 - 1.0;
#endif

Replace these line

ao = texture2DGradARB(normals, newCoord, dcdx, dcdy).z;

normalMap = vec3(texture2DGradARB(normals, newCoord, dcdx, dcdy).xy, 0.0) * 2.0 - 1.0;

With these line

#ifdef PARALLAX
ao = texture2DGradARB(normals, newCoord, dcdx, dcdy).z;

normalMap = vec3(texture2DGradARB(normals, newCoord, dcdx, dcdy).xy, 0.0) * 2.0 - 1.0;
#else
ao = texture2D(normals, texCoord).z;

normalMap = vec3(texture2D(normals, texCoord).xy, 0.0) * 2.0 - 1.0;
#endif

What this patch done is preventing Normal Map and Specular Map got shifted and stretched even when Parallax Occlusion Mapping is turn off.

Shader Setting

In Minecraft Options/Video Settings/Shaders Packs…, select the BSL shader pack and then click Shaders Pack Settings….

Shaders

In Shaders Pack Configure/Material, turn on Advanced Materials and make sure the Material Format match the mod that dependent on MCglTF you used. (In most case SEUS/Old PBR)

Material

Optionally in Normals & Parallax, if you don't like Normal Map effect fade out when looking downward in first person, you can turn off Normal Dampening.

Normal Dampening

Now it is done. Enjoy the 3D models which provided by your Mod author that looked like it was coming from 3A Game.

AstraLex Shaders (BSL Edit)

https://lextermina7.wixsite.com/astralex

Preview

Patch gbuffers_entities.glsl

This patch is applied to the AstraLex Shaders v51.0 and above, similar to the issue that had been described above.

In this section, you need to use the Zip Archiver you familiar to fix gbuffers_entities.glsl.

gbuffers_entities.glsl is located at shaders/program/ of shaderpack zip file.

Extract gbuffers_entities.glsl for editing as describe below with the desired text editor you prefered, and then put it back into the shaderpack zip file once finish.

Find this line

float skipAdvMat  =float(entityId == 10100 || entityId == 10002 || entityId == 10312 || entityId == 10315);

Remove || entityId == 10312

float skipAdvMat  =float(entityId == 10100 || entityId == 10002 || entityId == 10315);

What this patch done is preventing normal mapped model in the Item Frame have weird lighting result after Minecraft version 1.12.2.

Shader Setting

In Minecraft Options/Video Settings/Shaders Packs…, select the AstraLex Shaders pack and then click Shaders Pack Settings….

Shaders

In Shaders Pack Configure/Advanced Materials, make sure Advanced Materials is on and the Material Format match the mod that dependent on MCglTF you used. (In most case Seus PBR (Old PBR))

Material

Then navigate into Reflections, turn on Specular Reflection and Rough Reflection.

Specular Reflections Rough Reflections

Optionally in Shaders Pack Configure/Advanced Materials, if you don't like Normal Map effect fade out when looking downward in first person, you can turn off Normal Dampening.

Normal Dampening

Now it is done. Enjoy the 3D models which provided by your Mod author that looked like it was coming from 3A Game.

Complementary Shaders

https://www.complementary.dev/shaders-v4/

Preview

Shader Setting

In Minecraft Options/Video Settings/Shaders Packs…, select the Complementary Shaders pack and then click Shaders Pack Settings….

Shaders

In Shaders Pack Configure, change RP Support to either labPBR (RP Required) or SEUS PBR (RP Required) based on the mod that dependent on MCglTF you used. (In most case SEUS PBR (RP Required))

Material

Now it is done. Enjoy the 3D models which provided by your Mod author that looked like it was coming from 3A Game.

⚠️ **GitHub.com Fallback** ⚠️