Suicizer | 2011-06-28 22:49
Your very own shader? Updated on 1st Juli 2011!
10
points ]
 (1 vote)
From old hudguns...

After I was experimenting with the shadersettings of the old hudguns included in assassin- and ctf-edition, I came up with the idea, why such shaders couldn't be used for textures?
So I tried to have the same settings for shaders on a normal texture (like caustics, water).
The effect seems to be even better than I thought, because it allows a separate moving copy of the texture.

Notifications of the version posted on the 26th of June 2011;
I don't know how it exactly works, because I'm pretty bad at scripting especially when it's not even cubescript.
I only know "MAD" is about the colour of the texture.

After some experimenting by combining shaders, I noticed such thing is not possible. So it can't be combined with any other shader (as far as I'm aware off, but please try it yourself and if you made any progress, please post a comment about it).
The shader also won't work if hudguns aren't showed (so like in edit mode). This is probably because it was used as shaders for hudguns only.
There seems to be an odd bug, which makes the texture stop scrolling when any scrolling texture gets hit by an explosive (like rockets or grenades), but continues after wards. Oddly, when covering the surface with alpha material, this bug won't occur.
After some experimenting with filling cubes with water while there also is a texture which carries those shaders in that cube, I've noticed that it seems like the shaders carry the same code as caustics do.

Like the demonstration map is showing, there could be made water with which do has geometry in it.
Another nice example in the demonstration map is animated caustics, which could be used very well for teleports or as a "field of energy".
A constantly changing gab into a white face could create sweet situations when used for gameplay to look trough a wall or a floor (when using blendmapping for example).
My last example is a "waving" animation by using the rocketpsource setting with 1 of the square brushes. Probably quite useful for letting a flag or something similar to that really "wave by the wind".

Notifications of the version on 1st July 2011;
After changing some stuff into the script, I noticed that "program.env[6]" isn't as buggy as "program.env[5]". So I recommend to use "program.env[6]" instead of the other previous one.
Explanation about some settings (like scrolling) is inside the configuration-file.
The command "vscroll" won't work on those textures, because the texture is getting scrolled in it's shaders already (shouldn't be a big problem, would it?).

I've added a way better demonstration map (still not font of it, but it fills it's purpose way better than the previous one).

If you know more about how these shaders are working, please don't be afraid and post a comment about it right here!

Thanks to geartrooper for making those awesome hudguns used in assassin- and ctf-edition!

P.S.
This is the code to do so:
shader 0 causticsworld1 [
@vpstart
PARAM seconds = program.env[6]; //Seems to change wich program it is running. Like "program.env[5]" is way less stable (tilts when hudgun is of or when it's hit by an explosion), while "program.env[6]" has no problems. Any other value won't work at all.

MAD result.texcoord[0], seconds, {0, 0.2, 0, 0}, vertex.texcoord[0]; //Scrolls the upper texture over the default texture.
MAD result.texcoord[1], seconds, {0, 0.25, 0, 0}, vertex.texcoord[0]; //Scrolls the default texture under the upper texture.

MOV result.color, vertex.color;

@fogcoord
END
] [
@fpstart
OPTION ARB_fog_linear;
TEMP dtc, diffuse;

TEX dtc, fragment.texcoord[0], texture[0], 2D;
MAD dtc.xy, dtc.xzxz, 0.4, fragment.texcoord[1]; //Increases the animated effect of the upper texture.
TEX diffuse, dtc, texture[0], 2D;

MOV result.color.rgb, diffuse;
MUL result.color.a, diffuse.a, fragment.color.a;

END
]

testshader_1juli11.zip (426.46 KB)
10
points
 (1 vote)
User login
Users on Quadropolis
1 guest & no users online
Created 2024-06-02 22:13
3 weeks 5 days ago
Created 2024-06-02 14:26
3 weeks 5 days ago
vampirefrog
Created 2024-04-11 22:25
11 weeks 1 day ago
vampirefrog
29
points ]
 (4 votes)
Created 2010-05-30 10:00
14 years 4 weeks ago
Gangler
36
points ]
 (4 votes)
Created 2020-10-22 00:50
3 years 35 weeks ago
Zoocata
10
points ]
 (1 vote)
Created 2024-02-11 21:20
19 weeks 5 days ago
vampirefrog
10
points ]
 (1 vote)
Created 2023-07-23 20:02
48 weeks 5 days ago
36
points ]
 (4 votes)
Created 2020-12-10 12:49
3 years 28 weeks ago
Created 2023-12-12 23:34
28 weeks 3 days ago
Zoocata
Created 2023-11-27 23:00
30 weeks 4 days ago
20
points ]
 (2 votes)
Created 2023-10-01 15:21
38 weeks 5 days ago
20
points ]
 (2 votes)
Created 2021-05-24 00:01
3 years 5 weeks ago
9
points ]
 (1 vote)
Created 2023-06-13 17:54
1 year 2 weeks ago
Zoocata
27
points ]
 (3 votes)
Created 2023-05-05 20:58
1 year 7 weeks ago
Zoocata
18
points ]
 (2 votes)
Created 2023-03-02 01:40
1 year 17 weeks ago
Getridou
Created 2023-01-29 23:27
1 year 21 weeks ago
Created 2023-01-19 19:36
1 year 23 weeks ago
Getridou
Created 2023-01-10 17:10
1 year 24 weeks ago
Getridou
Created 2023-01-01 14:30
1 year 25 weeks ago
Getridou
10
points ]
 (1 vote)
Created 2023-01-01 10:58
1 year 25 weeks ago
Who's new
  • ColdIV
  • Aidan
  • Hunk
  • letic86
  • BATMAN