XEffects - Reloaded - New Release (V 1.4)
That's correct stefbuet, I think you'll find that it won't really be any faster though... (Maybe more noticeable will be the precision, since you won't have to do those operations on the value first).
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
You put as texture 1 & 2 your both render target on a quad.
Then you render the quad only with the following shader:
(don't forget to send uniform data from the shader callback)
But it's exactly what is done by XEffetct.
The shader is called modulateLight or something similar.
If you look at my code I've done what you want.
If you are using your own normal mapped shaders, you can remove the dot product in the XEffect shader to go a [very] little faster.
Then you render the quad only with the following shader:
(don't forget to send uniform data from the shader callback)
Code: Select all
varying vec2 textCoord;
void main() {
textCoord=gl_TexCoord0.xy;
}
Code: Select all
uniform sampler2D renderTarget1;
uniform sampler2D renderTarget2;
varying vec2 textCoord;
void main() {
gl_FragColor=texture2D(renderTarget1, textCoord)+texture2D(renderTarget2, textCoord);
}
The shader is called modulateLight or something similar.
If you look at my code I've done what you want.
If you are using your own normal mapped shaders, you can remove the dot product in the XEffect shader to go a [very] little faster.
-
- Posts: 1638
- Joined: Mon Apr 30, 2007 3:24 am
- Location: Montreal, CANADA
- Contact:
Hi would it there be a way to use XEFFECT to project textures? (So I could fake high detailed shadows) as from this link here:
http://udn.epicgames.com/Two/SpecialLig ... tures.html
Using this could create nice shadows and really fast render speed since there is no rendering of the scene. (I mean no RTT is needed since the shadow is pre-rendered).
http://udn.epicgames.com/Two/SpecialLig ... tures.html
Using this could create nice shadows and really fast render speed since there is no rendering of the scene. (I mean no RTT is needed since the shadow is pre-rendered).
-
- Posts: 2
- Joined: Tue Jul 27, 2010 4:04 pm
Hello, im sorry if this has been asked before, but is there some example on how to create directional lights/shadows? The kind that are used in "birdview" RTS games for example.
I've tried to create shadow lights with all kinds of values (with directional = true), but nothing seems to work. Either i get just a veeeery small dot of light or no light at all.
I've tried to create shadow lights with all kinds of values (with directional = true), but nothing seems to work. Either i get just a veeeery small dot of light or no light at all.
@christianclavet:
That's easy. Just draw an image on the shadow camera's depth map.
(You would have to modify the update method and draw the image
directly after the depth map was rendered.)
The image must only contain black and white pixels and nothing
in between but it should get soft edges because of the filtering.
And I think you could do that also instead of rendering the depth map.
That's easy. Just draw an image on the shadow camera's depth map.
(You would have to modify the update method and draw the image
directly after the depth map was rendered.)
The image must only contain black and white pixels and nothing
in between but it should get soft edges because of the filtering.
And I think you could do that also instead of rendering the depth map.
I thought I fixed those at some stage. I guess I need to include an example in the SDK to make sure it works. There is an old tutorial in the FAQ section (Search for Diablo style) but it's using an old version of XEffects.Mister Bucket wrote:Hello, im sorry if this has been asked before, but is there some example on how to create directional lights/shadows? The kind that are used in "birdview" RTS games for example.
I've tried to create shadow lights with all kinds of values (with directional = true), but nothing seems to work. Either i get just a veeeery small dot of light or no light at all.
@christianclavet: You will need to alter some of the shaders for that. Maybe I should create an example for it, but it needs some changes.
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
-
- Posts: 2
- Joined: Tue Jul 27, 2010 4:04 pm
That would be really helpful. I remember seeing your old tutorial, but since the old XEffects seemed to be very different to the new one so that wasnt much of help to me..BlindSide wrote: I thought I fixed those at some stage. I guess I need to include an example in the SDK to make sure it works. There is an old tutorial in the FAQ section (Search for Diablo style) but it's using an old version of XEffects.
XEffects has a lot of features I've been looking for, but it only works correctly on my machine using Direct3D - when I run the examples using OpenGL, I get a slew of FBO errors or other problems - e.g., in the case of example4, the program runs but the water isn't displayed, only the terrain node. In example5, the OpenGL version displays correctly except for a number of random white dots or small squares which seem to be left behind by the spheres as I move the view.
It looks like someone else has had similar problems.
Is there any 'fix' for this, or any planned fixes in the future?
It looks like someone else has had similar problems.
Is there any 'fix' for this, or any planned fixes in the future?
Whats your video card?
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
Well, I have a low-end notebook computer which has one of these "integrated" video controllers, described as "Mobile Intel(R) 4 Series Express Chipset Family". So the "video ram" is apparently virtual, borrowed as needed from system ram. Or something like that.BlindSide wrote:Whats your video card?
It was the cheapest notebook available with features that weren't entirely obsolete, purchased after my previous machine died an early death and I was on the brink of giving up technology entirely and living in a cave the rest of my life.
I'm fairly sure that one doesn't support the required render target formats, make sure to check the specs!
You may have to set a pow2 size for the screen RTT, and use 16 bit depth.
You may have to set a pow2 size for the screen RTT, and use 16 bit depth.
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 tried to add the water effect from example4 to my own program (which displays a custom terrain node made of procedurally-generated terrain, with a revolving "sun" in the form of a directional light). Nothing displays except the blue background color, even when I add the default TerrainSceneNode that was used in example4 itself. This terrain node (and the rest) are only displayed when I use the normal "smgr->drawAll();" rather than "effect->update();" - but oddly, the frame rate for my normal custom terrain is about three times faster than it used to be before I added XEffects. I'm not sure how it speeds up my own stuff even when I'm not using "effect->update();"
Any idea what might be preventing anything from rendering (except the blue background color)?
Any idea what might be preventing anything from rendering (except the blue background color)?
I've isolated the source of the above problem:
When using Direct3D, I get a large number of errors at run-time which all say:
"error X3506: unrecognized compiler target 'vs_3_0'"
The odd thing is that when I run the mouse pointer over "EVST_VS_3_0" in EffectHandler.cpp, VisualC++ recognizes it and gives a value of "3". Or isn't "EVST_VS_3_0" the same thing as the "vs_3_0" mentioned in the error message?
I noticed that when other people had this problem a few months ago, the only fix that was suggested was to recompile Irrlicht and see if that helps. Is there another fix?
When I use OpenGL, those errors disappear but I do get several "Unsupported texture format" errors and "FBO has one or several incomplete image attachments", "FBO error" and "FBO incomplete"
In OpenGL it does render the default terrain node and my own terrain, but the only shader effect is the underwater blue-green tint when you move below 0 in the Y axis.
Any help would be appreciated.
When using Direct3D, I get a large number of errors at run-time which all say:
"error X3506: unrecognized compiler target 'vs_3_0'"
The odd thing is that when I run the mouse pointer over "EVST_VS_3_0" in EffectHandler.cpp, VisualC++ recognizes it and gives a value of "3". Or isn't "EVST_VS_3_0" the same thing as the "vs_3_0" mentioned in the error message?
I noticed that when other people had this problem a few months ago, the only fix that was suggested was to recompile Irrlicht and see if that helps. Is there another fix?
When I use OpenGL, those errors disappear but I do get several "Unsupported texture format" errors and "FBO has one or several incomplete image attachments", "FBO error" and "FBO incomplete"
In OpenGL it does render the default terrain node and my own terrain, but the only shader effect is the underwater blue-green tint when you move below 0 in the Y axis.
Any help would be appreciated.