Extended Shaders Mod

What is Extended Shaders

q

Extended Shaders is created by FirEmerald.

Shader API for ANY mod!

You cannot use this API without a good understanding of GLSL, including the compatibility profile as that is what you will be using.

This mod is 100% Optifine compatible. However, post-processing will ONLY work if "fast render" is OFF.
You can turn shaders on/off in the "Video Settings" menu. (Under "Other" if Optifine is installed.)

this mod REQUIRES your GPU support AT LEAST OpenGL 2.1. It will crash if you do not. This is purposeful.

Extended Shaders is a coremod API that allows ANY forge mod to use shaders, without needing to mess with coremodding and still being compatible with other mods that use shaders via this API.
It allows mods to add shaders and post-processing effects!

Basic how-to-use:

you will need to add the API classes to your project, PRESERVING the package names.
 HOW TO MAKE A SHADER:
  TO MAKE A VERTEX SHADER:
   1. create a file in your mod's assets, containing a list of the uniforms, variables, and constants, like this:
    uniform float burnAmount; //uniform
    varying vec4 fragCol; //variable
    #define col vec3(.976, .969, .816) //constant
   2. create a file in your mod's assets, containing the code for the shader, like this:
    fragCol = fragCol * col;
   3. create a new ShaderData instance, like this:
    vertShader = new ShaderData(new ResourceLocation(modid, uniformslocation), new ResourceLocation(modid, codelocation), uniform name 1, uniform name 2, ...);
   4. to turn it ON, do this:
    ShaderRegistry.addVertexShader(vertShader);
   5. to turn it OFF, do this:
    ShaderRegistry.removeVertexShader(vertShader);
  TO MAKE A FRAGMENT SHADER:
   1. create a file in your mod's assets, containing a list of the uniforms, variables, and constants, like this:
    uniform float burnAmount; //uniform
    varying vec2 textureCoords; //variable
    #define col vec3(.976, .969, .816) //constant
   2. create a file in your mod's assets, containing the code for the shader. you will work via modifying gl_fragData[0], or setting it if you prefer, like this:
    float depth = sqrt(eyePos.x * eyePos.x + eyePos.y * eyePos.y + eyePos.z * eyePos.z);
    if (depth > 64.0) discard;
    depth = clamp(depth / 64.0, 0, 1);
    float val = (max(max(gl_FragData[0].r, gl_FragData[0].g), gl_FragData[0].b) + min(min(gl_FragData[0].r, gl_FragData[0].g), gl_FragData[0].b)) * .25;
    gl_FragData[0] = vec4(vec3(1.0) - col * (depth + val - depth * val), gl_FragData[0].a);
   3. create a new ShaderData instance, like this:
    fragShader = new ShaderData(new ResourceLocation(modid, uniformslocation), new ResourceLocation(modid, codelocation), uniform name 1, uniform name 2, ...);
   4. to turn it ON, do this:
    ShaderRegistry.addFragmentShader(fragShader);
   5. to turn it OFF, do this:
    ShaderRegistry.removeFragmentShader(fragShader);
  PROVIDED UNIFORMS:
   sampler2D tex //the current texture
   sampler2D light //the lightmap
   bool useTex //whether textures are enabled
   bool useFog //whether fog is enabled
   bool isAlias //whether the current texture is the block & item alias
   bool isEntity //whether the currently rendering object is a living entity
   bool useNormals //whether normal-based lighting is enabled (entities, tileentities, items in hand, ect.)
   bool useLighting //whether lightmap-based lighting is enabled (block lighting)
   int renderPass //the current render pass
  PROVIDED VARIABLES:
   vec4 texCoords //the texture coordinates
   vec4 fragCol //the fragment color (after lighting, includes the value set by GL11.color4f, ect.)
   vec3 fragNorm //the fragment normal
   vec4 eyePos //the fragment position, relative to the projection
 HOW TO MAKE A POST-PROCESSOR:
  1. create a file in your mod's assets, containing a list of the post-processor's uniforms and constants, like this:
   uniform float currentTime; //uniform
   #define rad 3.0 //constant
  2. create a file in your mod's assets, conatining the post-processor's code, like this:
   float tx1 = rad * dx;
   float tx2 = tx1 * .5;
   float ty = rad * .5 * sqrt(3.0) * dy;
   vec3 cp1 = texture2D(tex0, texCoords).rgb;
   vec3 cp1 = texture2D(tex0, texCoords + vec2(tx1, 0)).rgb;
   vec3 cp3 = texture2D(tex0, texCoords + vec2(tx2, ty)).rgb;
   vec3 cp4 = texture2D(tex0, texCoords + vec2(-tx2, ty)).rgb;
   vec3 cp5 = texture2D(tex0, texCoords + vec2(-tx1, 0)).rgb;
   vec3 cp6 = texture2D(tex0, texCoords + vec2(-tx2, -ty)).rgb;
   vec3 cp7 = texture2D(tex0, texCoords + vec2(tx2, -ty)).rgb;
   gl_FragData[0] = vec4((cp1 + cp2 + cp3 + cp4 + cp5 + cp6 + cp7) / 7, 1);
  3. create a new PostProcessor instance, like this
   postProcessor = new PostProcessor(new ResourceLocation(modid, uniformslocation), new ResourceLocation(modid, codelocation), uniform name 1, uniform name 2, ...);
  4. to turn it ON use this:
   PostProcessorRegistry.addPostProcessor(postProcessor);
  5. to turn it OFF use this:
   PostProcessorRegistry.removePostProcessor(postProcessor);
  PROVIDED UNIFORMS:
   sampler2D tex0//the current render scene
   sampler2D tex1 //extra data used by Metroid Cubed 3
   sampler2D tex2 //extra data used by Metroid Cubed 3
   sampler2D tex3 //extra data used by Metroid Cubed 3
   sampler2D tex4 //extra data used by Metroid Cubed 3
   float dx //x-distance between pixels
   float dy //y-distance between pixels
   int eye //The current "eye" - -1 for no anaglyph, 0 for red, 1 for cyan
  PROVIDED VARIABLES:
   vec2 texCoords //current pixel location

How to install Mod:

(1) Install the version of Minecraft Forge that corresponds with the mod

(2) Download the Mod.

(3) Drop the entire zipped file into your mods folder (Search %appdata% on your PC then go into .minecraft, then mods(create this folder if it is not there))

(4) Open Minecraft and make sure your profile is set to Forge

(5) Start Minecraft and enjoy!

Download

File Name Status Version Downloads Date
[1.10.2] Extended Shaders 4.1.jar release 1.10.2 11,227 11/09/2017
[1.12.2] Extended Shaders 7.1b.jar release 1.12.2 1,989 07/04/2019
[1.7.10] Extended Shaders 6.0.jar release 1.7.10 11,224 21/02/2018
Extended Shaders Mod 1.20.2 Updating 1.20.2 Updating Updating
Extended Shaders Mod 1.20.1 Updating 1.20.1 Updating Updating
Extended Shaders Mod 1.20 Updating 1.20 Updating Updating
Extended Shaders Mod 1.19.2 Updating 1.19.2 Updating Updating
Extended Shaders Mod 1.19.1 Updating 1.19.1 Updating Updating
Extended Shaders Mod 1.19 Updating 1.19 Updating Updating
Extended Shaders Mod 1.18 Updating 1.18 Updating Updating
Extended Shaders Mod 1.17.1 Updating 1.17.1 Updating Updating
Extended Shaders Mod Forge Updating Forge Updating Updating
Extended Shaders Mod Fabric Updating Fabric Updating Updating
Extended Shaders Mod
Extended Shaders Mod

Dear youtuber!
Have you a channel youtube and want to bring your Video to quality visitors?
Do you want your video to appear on our website?
Do you want to become partner with us?
Just 3 steps to become our partner:
Step 1: Make video review for mods, addons, plugins, ... which you like
Step 2: Upload this video to youtube and our link to your video description
Step 3: Send the youtube video link via message to http://fb.com/9lifehack or leave a comment in the post. We will add your video in the our post, it will help you have more view.
JOIN to get more youtube view with us!!!!

Related Posts

Smarty Productivity Happiness

9LifeHack.com - make things smart