dex Frequent poster


Status:Offline Date registered: 11.09.2007 Post:14 Send Message | Created on 13.09.2007 - 22:20 |  |
This is a shader by VerGreeneyes who created it in less than a day after an idea I had.
The purpose of this shader is to change a specific color (light green) used for the Motion Tracker HUD in the game "Alien Trilogy" to blue (movie like).
Lengthy explanation:
This game is based solely on a movie franchise (it has not much else to it than simply showing off as many features as possible directly from the movie, using its licence) and the developers decide the one color you see CONSTANTLY in the game to be GREEN. Also every menu and text etc. is green. The whole "Aliens" movie seems to be filmed with a BLUEISH filter and the motion tracker has a blue display. As a fan of the movie I was searching for a way to finally change this and make this MOVIELIKE. Actually it is the next best "Alien" game after Aliens vs. Predator.
I posted this story and my idea about a shader to change only one specific color in these forums and in no time I had a working solution coded by VerGreeneyes from these forums. The shader can also be configured and adjusted.
This is the Motion Tracker as seen in the movie "Aliens" (notice it is BLUE):
http://gioco.net/aandp/MotionTracker2.jpg

This picture shows the tracker in the game "Alien Trilogy" (notice it is in ugly GREEN):

This is the tracker with VerGreeneyes shader:

But the Alien-acid as well as walls, warning signs etc. are still green. Also the Pulse Rifle has the right green parts:

So the shader changes effectively only the one ugly green colour for the HUD and menus. Other textures and movies with greenish elements are little to not affected. This is especially useful for the game "Alien Trilogy" but will work on other games as well of course.
fragment file (.slf):
| Code: | | 1: | | 2: | | 3: | | 4: | | 5: | | 6: | | 7: | | 8: | | 9: | | 10: | | 11: | | 12: | | 13: | | 14: | | 15: | | 16: | | 17: | | 18: | | 19: | | 20: | | 21: | | 22: | | 23: | | 24: | | 25: | | 26: | | 27: | | 28: | | 29: | | 30: | | 31: | | 32: | | 33: | | 34: | | 35: | | | | uniform sampler2D OGL2Texture;
|
| const float HUE_ADJUSTMENT = 100.;
| const float LOWER_LIMIT = 100.;
| const float UPPER_LIMIT = 140.;
|
| void main()
| {
| vec4 C = texture2D(OGL2Texture,gl_TexCoord[0].xy);
| float V = max(C.r,max(C.g,C.b)),
| D = V - min(C.r,min(C.g,C.b)),
| H = 60. / D, S = bool(V) ? D / V : 0.;
| if(S){
| H = ((V == C.r) ? H * (C.g - C.b) : (V == C.g) ? 120. + H * (C.b - C.r) : 240. + H * (C.r - C.g));
| if(H >= LOWER_LIMIT && H < UPPER_LIMIT){
| H += HUE_ADJUSTMENT;
| H += 360. * (float(H < 0.) - float(H >= 360.));
| H /= 60.;
| D = floor(H);
| H = fract(H);
| if(mod(D,2.)){
| C.r = V * (1. - H * S);
| C.g = V * (1. - S);
| }else{
| C.r = V * (1. - S);
| C.g = V * (1. - (1. - H) * S);
| }
| if((D = floor(++D/2.)) == 1.) gl_FragColor.rgb = vec3(C.r,V,C.g);
| else if(D == 2.) gl_FragColor.rgb = vec3(C.g,C.r,V);
| else gl_FragColor.rgb = vec3(V,C.g,C.r);
| }else gl_FragColor = C;
| gl_FragColor.a = C.a;
| }else gl_FragColor = C;
| }
| | |
vertex file (.slv):
| | | | void main()
| {
| gl_Position = ftransform();
| gl_TexCoord[0] = gl_MultiTexCoord0;
| }
| | |
Thank you very much VerGreeneyes for turning this crazy idea into reality 
[Dieser Beitrag wurde am 13.09.2007 - 22:22 von dex aktualisiert]
|