Hi guys...
I found a quite old thread talking about a raindrop effect
http://irrlicht.sourceforge.net/phpBB2/ ... ater+glass
but that i wanted to do is the same effect of the raindrops but that influence the camera(like a post process effect)
there is something of this kind in the forum? i found none like this....
it's hard to do???
thans for the help.....
help about make a water effect in the screen
-
- Posts: 52
- Joined: Wed Mar 03, 2010 7:11 pm
well i don't have a server or web address to upload screenshots, but i've managed to develop a particle system for rain, not all that difficult using the the screenfx tutorial. but you want rain to fall on the camera? like little raindrops you see on the cameras for live sporting events? maybe you should draw a 2D image on the camera, or alter the particle system and place it directly place it in front of the camera.
Kamikaze
I think you'd need some kind of post-processing for the raindrops to achieve that kind of effect.
If you're new to that kind of stuff, you'll want to first learn the basics of pixel shaders. I use HLSL, but you can also program shaders in GLSL (for Open GL), Cg (you'll need a plug-in to use Cg shaders in Irrlicht), or Assembly. Once how you know how shaders work, here's the basics for doing post-processing:
If you're new to that kind of stuff, you'll want to first learn the basics of pixel shaders. I use HLSL, but you can also program shaders in GLSL (for Open GL), Cg (you'll need a plug-in to use Cg shaders in Irrlicht), or Assembly. Once how you know how shaders work, here's the basics for doing post-processing:
- Render the scene to a Render Target Texture
- Create a quad (a pair of triangles) and set the texture of that quad to the RTT you just rendered
- Apply your post-processing shader material type to that quad
- Render that quad to the screen, which will display it after applying your post-processing
A friend who is a professional game developer taught me HLSL, but here are a few tutorials I picked up along the way. None of them except the first are for Irrlicht, but the Irrlicht side of things isn't bad at all. Just look at the shaders example.
http://www.irrlicht3d.org/pivot/entry.php?id=158 (make sure you see part 2. Don't be weirded out that the shader is stored in a char array - in Irrlicht you can either do this or save it in a file.)
http://blogs.microsoft.co.il/blogs/tami ... orial.aspx
http://www.riemers.net/eng/Tutorials/Di ... uction.php
A few notes:
http://www.irrlicht3d.org/pivot/entry.php?id=158 (make sure you see part 2. Don't be weirded out that the shader is stored in a char array - in Irrlicht you can either do this or save it in a file.)
http://blogs.microsoft.co.il/blogs/tami ... orial.aspx
http://www.riemers.net/eng/Tutorials/Di ... uction.php
A few notes:
- Basically you're going to want to use tex2D to sample your input texture and do something to determine an output in the pixel shader.
- For post-processing, you don't usually need to worry about a vertex shader.
- Just remember that tex2D takes an input of UV coordinates (normalized from 0 to 1), not pixel coordinates.
- Irrlicht will automatically set your sampler (texture) variables in your shader if you declare them to the correct register. To declare the first texture, do
This declares the texture variable to the first texture register, s0. The second texture in a material is found at s1, and so on.
Code: Select all
sampler2D tex0 : register(s0)
- Things like COLOR and TEXCOORD are called semantics. They help the shader compiler know what the variables mean. Your pixel shader will always return a COLOR (for the pixel it's outputting).
- Don't worry about "Techniques" or "Passes." Irrlicht does this automatically for you. All you need to write is your shader function(s).
Last edited by slavik262 on Tue May 25, 2010 11:34 am, edited 1 time in total.
I've thought about this before, basically you draw a normal map/offset map on an RTT of a rain drop (And move it around etc), and use the RTT to distort the screen.
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
i'm sorry i have to ask again...
i don't understant the steps i have to do...
and i've tried to find good resources but i fail......
the RTT must be a texture of something...right?
i thought it was a thing that needed only the texture....and using the glsl i could manipolate the screen using only the texture....
the code of the glsl in only this:
than it changes only the alpha channel???
i don' understand well...
[/list]
i don't understant the steps i have to do...
and i've tried to find good resources but i fail......
the RTT must be a texture of something...right?
i thought it was a thing that needed only the texture....and using the glsl i could manipolate the screen using only the texture....
the code of the glsl in only this:
Code: Select all
uniform mat4 mWorld;
uniform vec4 CamPos;
uniform float TexMul, AlphaAdjust;
varying vec4 GlassPos;
varying vec2 TexCoord;
varying float VAlpha;
void main()
{
VAlpha = gl_Color.a * AlphaAdjust;
TexCoord = gl_MultiTexCoord0.xy;
GlassPos = ftransform();
gl_Position = GlassPos;
}
i don' understand well...
[/list]