hi,
I need a simple shader, but I have no experiences with shaders... :'(
I found many tutorials on the web, but I have no time (and pacience) to dig through tons od tutorial just for a single shader...
what I need is a shader that darkens/lightens the scene depending on a value...
maybe a value from 0 to 100 (0 = dark and 100 = bright)...
I want to create a day/night/dusk/dawn effect...
I guess this would be a post process shader, right ???
mainly I need it for dx, but one for ogl in addition would be great, too !!!
also I'm not sure how to use post process shaders with Irrlicht, the shader tutorial only shows the use with scene nodes...
or do I simply have to set the shader to the camera node for this ???
I hope someone is so kind...
thx, Acki
need a simple shader
need a simple shader
while(!asleep) sheep++;
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
-
- Competition winner
- Posts: 1123
- Joined: Sun Jun 10, 2007 11:14 pm
That's how you could brighten a texture in GLSL. uniform float adjust is your callback var 1.0 means no change, a higher value brightens the texture up. Not exactly what you want, but maybe it helps. I'm still learning myself
// Vertex Shader
// Frag Shader
// Vertex Shader
Code: Select all
varying vec2 tex_coord;
void main()
{
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
tex_coord = vec2(gl_MultiTexCoord0);
}
Code: Select all
varying vec2 tex_coord;
uniform sampler2D tex_color;
uniform float adjust;
void main()
{
gl_FragColor = texture2D(tex_color, tex_coord) * adjust;
}
Never take advice from someone who likes to give advice, so take my advice and don't take it.
ahh, I saw a tutorial of game studio shaders and they used the camera for the post processing directly...Lonesome Ducky wrote:With post processing, you would usually render the scene to a texture, then render to a screen aligned quad. This would allows the shader to change colors of the screen and so on.
well, in this case I'll have to overthink my strategy though...
that look pretty promissing !!!Bate wrote:1.0 means no change, a higher value brightens the texture up. Not exactly what you want, but maybe it helps.
now I have basics I can work/test with !!!
I guess I'll get the implementation to work now, at least for ogl (maybe I get it converted to dx on myself)...
thank you both, very much !!!
while(!asleep) sheep++;
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java