Suicizer | 2011-06-28 22:49
Your very own shader? Updated on 1st Juli 2011!
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!

This is the code to do so:
shader 0 causticsworld1 [
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;

] [
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;

] (426.46 KB)
 (1 vote)
User login
Users on Quadropolis
1 guest & no users online
Created 2023-05-05 20:58
2 weeks 2 days ago
points ]
 (2 votes)
Created 2023-03-02 01:40
11 weeks 4 days ago
Created 2023-01-29 23:27
16 weeks 6 hours ago
Created 2023-01-19 19:36
17 weeks 3 days ago
Created 2023-01-10 17:10
18 weeks 5 days ago
Created 2023-01-01 14:30
20 weeks 15 hours ago
Created 2023-01-01 10:58
20 weeks 19 hours ago
Created 2023-01-01 10:49
20 weeks 19 hours ago
points ]
 (2 votes)
Created 2023-01-01 06:32
20 weeks 23 hours ago
points ]
 (7 votes)
Created 2010-04-01 07:57
13 years 7 weeks ago
points ]
 (6 votes)
Created 2020-12-04 12:05
2 years 24 weeks ago
points ]
 (1 vote)
Created 2022-04-21 09:26
1 year 4 weeks ago
points ]
 (1 vote)
Created 2022-01-23 15:48
1 year 16 weeks ago
Created 2021-11-05 01:27
1 year 28 weeks ago
points ]
 (4 votes)
Created 2020-12-10 12:49
2 years 23 weeks ago
points ]
 (4 votes)
Created 2012-08-30 04:30
10 years 38 weeks ago
points ]
 (1 vote)
Created 2019-10-16 01:26
3 years 31 weeks ago
points ]
 (1 vote)
Created 2021-06-17 22:42
1 year 48 weeks ago
points ]
 (3 votes)
Created 2020-11-30 04:00
2 years 24 weeks ago
points ]
 (1 vote)
Created 2021-05-24 00:01
1 year 51 weeks ago
Who's new
  • ColdIV
  • Aidan
  • Hunk
  • letic86