Page 39 of 56

Posted: Thu Jul 08, 2010 3:01 am
by BlindSide
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).

Posted: Sun Jul 11, 2010 6:11 pm
by MontyTRC
wing64 wrote:@MontyTRC:
Easy way to combine normal map with shadow ->
1. Rendering normal map to rt0
2. Rendering shadow to rt1
3. Then combine both rt0 and rt1.
Cheers. :D
Thank you :)

One more question... How can I combine multiple render targets in one final render?

:)

Posted: Mon Jul 12, 2010 9:16 am
by stefbuet
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)

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);
}
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.

Posted: Mon Jul 12, 2010 4:52 pm
by christianclavet
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).

Posted: Tue Jul 27, 2010 4:19 pm
by Mister Bucket
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.

Image

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.

Posted: Tue Jul 27, 2010 8:39 pm
by porcus
@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.

Posted: Wed Jul 28, 2010 3:07 am
by BlindSide
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.

Image

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 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.

@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.

Posted: Wed Jul 28, 2010 10:24 am
by Mister Bucket
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.
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..

Posted: Sat Jul 31, 2010 9:06 pm
by ACE247
Maybe a dumb question, can I use XEffects with Normal/Parallax mapped scene nodes?

Posted: Tue Aug 10, 2010 4:08 pm
by AW111
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?

Posted: Wed Aug 11, 2010 12:29 am
by BlindSide
Whats your video card?

Posted: Wed Aug 11, 2010 1:12 am
by AW111
BlindSide wrote:Whats your video card?
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.
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.

Posted: Wed Aug 11, 2010 8:13 am
by BlindSide
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.

Posted: Wed Aug 11, 2010 11:37 pm
by AW111
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)?

Posted: Thu Aug 12, 2010 9:35 pm
by AW111
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.