Well hello!
This is a very simple mod that takes great advantage of the GLSL shaders mod by daxnitro!
It will drastically improve visibility, allowing you to explore caves without the fear of what is in the shadows ahead, or wander the night without wasting so many torches!
This shader works by simply "linking" the shader so that it is turned on when equipped with Glowstone. Why Glowstone, you might ask? Well it is quite difficult to obtain (you'll need tons of buckets or a diamond pickaxe for the Nether), and it just makes sense. The item ID can easily be changed to, say, a custom item (see "The Future").
This is a must have for any miner!
NOTE: Because this uses GLSL shaders, it is only compatible with graphics cards that support GLSL. If you're on a mac, you're likely to be fine. If you're on a PC and have a generic on-board card, you're out of luck. Compatibility list:
* ATI Radeon 9x00, Xx00, X1x00, HD2x00 and HD3x00 series and newer.
* NVidia Geforce FX, 6x00, 7x00, 8x00, 9x00 and GTX 2x0 and newer.
///////////////////////
//NIGHVTISION //
// By: Megusta //
// //
// Noise: Martinsh //
// Vignette: GeeXLab //
///////////////////////
uniform sampler2D sampler0;
uniform int worldTime; //An ever-changing constant for noise
struct lightSource {
int itemId;
float magnitude;
vec4 specular;
};
uniform lightSource heldLight;
//CUSTOMIZABLE PARAMETERS FOR AVERAGE USER////////////////////////////////////////////////
//
float noiseamount = 0.5; //Amount of noise //
vec2 lensRadius = vec2(0.65, 0.0); //Radius and feathering of vignette //
vec3 nvcol = vec3(1.1, 4.0, 1.1); //Change these values for nightvision color.//
// (red, green, blue) //
//
//////////////////////////////////////////////////////////////////////////////////////////
void main(void)
{
//Noise
float noise = (fract(sin(dot(gl_TexCoord[0].st ,vec2(12.0,78.0)+worldTime)) * 43758.0));
//
//Nightvision
vec4 texcolor = texture2D(sampler0, gl_TexCoord[0].st);
float gray = dot(texcolor.rgb, vec3(1.0, 1.0, 1.0)); //The gray
//
//vignette
float dist = distance(gl_TexCoord[0].xy, vec2(0.5,0.5));
vec4 vigfin = smoothstep(lensRadius.x, lensRadius.y, dist);
//
if (heldLight.itemId == 89) //Glowstone ID is 89
gl_FragColor = (vec4(gray * nvcol, texcolor.a) + noise*noiseamount) * vec4(vigfin.rgb, 1.0); //Night vision if equipped with glowstone
else /*Green Noise Vignette*/
gl_FragColor = texcolor; //Normal if not
}
The comments are spazzed out because I was writing in Notepad++ . . . I am too wiped out right now to fix it.
Solution: edit it in Notepad++, or not, IDK if that will do anything. I'm tired.
INSTALLATION
1. Download Daxnitro's GLSL shaders mod
2. Extract the zip
3. Navigate to: \mods\shaders\contents\files\shaders in the extracted zip
4. Replace my final.fsh file with the one in the shaders folder.
5. Go back to the root folder, and click the installer and hit "Install Mods"
6. According to a few others, you may need to add a blank "terrain_nh.png" and/or "terrain_s.png" in the minecraft jar in order for this to work. I have not experienced this problem, so I cannot provide support for it.
7. Done!
OTHER INFORMATION
This is very customizable, and I've made it very n00b friendly with comments. Of course, you'll need Notepad++ to view them, because they spazzed out :Pig:. If you're a n00b, then just edit the numbers in the boxed section. Make sure you add ".0" to the end of the number if it is an integer though.
Also, a huge thanks to DAXNITRO for making this possible and helping me out!
Why are my other shaders not working anymore?
Only one final.fsh shader can be used at once. That means if you use this, you cannot use the DOF or any other shader. I'll be happy to smush it with another shader if you like.
DERP
What?
The Future
I do not know Java, so I can't make my own item with its own ID that could toggle this. Currently, it's only using Glowstone, which has the ID of 89.
This mod is finished and released, but it would be even better if someone who is interested could work on an accompanying mod for this. I was thinking a craftable Nightvision item:
Where = Glowstone
It would be even better if you could run it off of Glowstone dust, like a furnace type thing . . .
If ANYBODY is interested, please PM me!
TO-DO
Fix comments
Make a video
Use custom item
FIX THIS POST & PROOFREAD
Anything else I've missed?
The compatibility of this shader relies on the compatibility of Daxnitro's mod. I don't think the two are compatible, as it says on Dax's wiki that modloader is not fully compatible with the shaders mod. I'm not sure about this.
I made this as a kind of more "realistic" step up from SDK's, something that would realistically benefit you without being too overpowering. That being said, I should also decrease the peripherals by making the lens smaller to make it less overpowering as well as reduce the noise, more like true nightvision goggles . . .
Well hello!
This is a very simple mod that takes great advantage of the GLSL shaders mod by daxnitro!
It will drastically improve visibility, allowing you to explore caves without the fear of what is in the shadows ahead, or wander the night without wasting so many torches!
This shader works by simply "linking" the shader so that it is turned on when equipped with Glowstone. Why Glowstone, you might ask? Well it is quite difficult to obtain (you'll need tons of buckets or a diamond pickaxe for the Nether), and it just makes sense. The item ID can easily be changed to, say, a custom item (see "The Future").
This is a must have for any miner!
NOTE: Because this uses GLSL shaders, it is only compatible with graphics cards that support GLSL. If you're on a mac, you're likely to be fine. If you're on a PC and have a generic on-board card, you're out of luck. Compatibility list:
* ATI Radeon 9x00, Xx00, X1x00, HD2x00 and HD3x00 series and newer.
* NVidia Geforce FX, 6x00, 7x00, 8x00, 9x00 and GTX 2x0 and newer.
And then some.
SCREENSHOTS
Dump:
VIDEO DEMONSTRATION
DOWNLOAD
LINK
And the code:
The comments are spazzed out because I was writing in Notepad++ . . . I am too wiped out right now to fix it.
Solution: edit it in Notepad++, or not, IDK if that will do anything. I'm tired.
INSTALLATION
1. Download Daxnitro's GLSL shaders mod
2. Extract the zip
3. Navigate to: \mods\shaders\contents\files\shaders in the extracted zip
4. Replace my final.fsh file with the one in the shaders folder.
5. Go back to the root folder, and click the installer and hit "Install Mods"
6. According to a few others, you may need to add a blank "terrain_nh.png" and/or "terrain_s.png" in the minecraft jar in order for this to work. I have not experienced this problem, so I cannot provide support for it.
7. Done!
OTHER INFORMATION
This is very customizable, and I've made it very n00b friendly with comments. Of course, you'll need Notepad++ to view them, because they spazzed out :Pig:. If you're a n00b, then just edit the numbers in the boxed section. Make sure you add ".0" to the end of the number if it is an integer though.
Also, a huge thanks to DAXNITRO for making this possible and helping me out!
Also, the vignette is based off of Martinsh's Blender 2D filters . . . go check em out!
The Noise is based off of the GeeXLab example.
FAQ
1. Why is it not working?
IDK.
Why are my other shaders not working anymore?
Only one final.fsh shader can be used at once. That means if you use this, you cannot use the DOF or any other shader. I'll be happy to smush it with another shader if you like.
DERP
What?
The Future
I do not know Java, so I can't make my own item with its own ID that could toggle this. Currently, it's only using Glowstone, which has the ID of 89.
This mod is finished and released, but it would be even better if someone who is interested could work on an accompanying mod for this. I was thinking a craftable Nightvision item:
Where = Glowstone
It would be even better if you could run it off of Glowstone dust, like a furnace type thing . . .
If ANYBODY is interested, please PM me!
TO-DO
Fix comments
Make a video
Use custom item
FIX THIS POST & PROOFREAD
Anything else I've missed?
The compatibility of this shader relies on the compatibility of Daxnitro's mod. I don't think the two are compatible, as it says on Dax's wiki that modloader is not fully compatible with the shaders mod. I'm not sure about this.
I made this as a kind of more "realistic" step up from SDK's, something that would realistically benefit you without being too overpowering. That being said, I should also decrease the peripherals by making the lens smaller to make it less overpowering as well as reduce the noise, more like true nightvision goggles . . .
And a BUMP!