XEffects - Reloaded - New Release (V 1.4)

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
Mel
Competition winner
Posts: 2292
Joined: Wed May 07, 2008 11:40 am
Location: Granada, Spain

Post by Mel »

The water shader is great. It looks incredibly well. Though it lacks scroll, with a scroll for the waves, it would be perfect.
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
MikeDee
Posts: 35
Joined: Wed Nov 18, 2009 11:41 pm

Post by MikeDee »

edit: nevermind fixed my problem. :D

Fantastic work there, congratulations ! :wink:
klaudia
Posts: 20
Joined: Thu Jun 18, 2009 2:39 pm

Post by klaudia »

hmm OpenGL version in my GF7300GT have some problems with run this library. (with versione XeffectR1.3)

Could not open file or texture: XEFFECT_SM_1024
XEffect: please ignore previous warning....
FBO has one or several incomplete image attachments
FBO error
FBO incomplete
Could not open file or texture: XEFFECT_SM_1024
XEffect: please ignore previous warning....


but when i choose DirectX9 all working fine.
ent1ty
Competition winner
Posts: 1106
Joined: Sun Nov 08, 2009 11:09 am

Post by ent1ty »

Is there any way I can have a 360 degrees light? And not using multiple lights to do this, of course. Just one.
3DModelerMan
Posts: 1691
Joined: Sun May 18, 2008 9:42 pm

Post by 3DModelerMan »

How do I change the shader directory in the new release? I want it to use the directory that I put into my project.
That would be illogical captain...

My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
3DModelerMan
Posts: 1691
Joined: Sun May 18, 2008 9:42 pm

Post by 3DModelerMan »

I'm also getting: ERROR cannot set render target.
That would be illogical captain...

My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
ent1ty
Competition winner
Posts: 1106
Joined: Sun Nov 08, 2009 11:09 am

Post by ent1ty »

How does the directional light work? I tried

Code: Select all

effect->addShadowLight(SShadowLight(sunShadowDim, vector3df(0, 1000, 0), vector3df(0, 0, 0), //real sun
		SColor(0, 200, 150, 150), 500.0f, 2000.0f, 90.0f * DEGTORAD, true));
but there was no light..

EDIT: figured it out, just need to change FOV to some high number like 90000*DEGTORAD
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

3DModelerMan wrote:How do I change the shader directory in the new release? I want it to use the directory that I put into my project.
There is no shader directory because all the default shaders are embedded in the source code.
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
IrrDelphi
Posts: 32
Joined: Tue Oct 13, 2009 10:59 am

Post by IrrDelphi »

BlindSide, good work! But i can't understand. Why XEFFECT not integrated into irrlicht library?
Insomniacp
Posts: 288
Joined: Wed Apr 16, 2008 1:45 am
Contact:

Post by Insomniacp »

He did state that he was going to do that for the next release most likely. I don't have time to find the exact post to quote or link to it though.
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

ent1ty wrote:How does the directional light work? I tried

Code: Select all

effect->addShadowLight(SShadowLight(sunShadowDim, vector3df(0, 1000, 0), vector3df(0, 0, 0), //real sun
		SColor(0, 200, 150, 150), 500.0f, 2000.0f, 90.0f * DEGTORAD, true));
but there was no light..

EDIT: figured it out, just need to change FOV to some high number like 90000*DEGTORAD
Try to use as small an FOV as possible to get better quality. For Orthogonal shadows the FOV is basically just the width and height of the view, so smaller view == better quality.
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
wonton
Posts: 1
Joined: Sat Nov 28, 2009 7:44 pm

Post by wonton »

Hello, getting errors here on certain CD3D9HLSLMaterialRenderer::setVariable() calls.

I'm completely lost on this one. Running this on:
  • Windows 7 Ultimate, Directx 11.
    Running Irrlicht engine with EDT_DIRECT3D9.
    NVIDIA Quadro FX 570M.
    Using the VS_2_a and PS_2_a trick.
    Having 3 shadow casting objects in my scene
    Having 1 shadow casting light in my scene (+1 irrlicht light)
    Having 1 shadow receiving object in my scene
I debugged the entire call cycle to setVariable() and came with this (repeating) list:

Code: Select all

LightPos <-- Error setting float array for HLSL variable
MaxD
MAPRES
LightColour
screenX
screenY
LineStarts0
LineStarts1
LineStarts2
LineStarts3
LineEnds0
LineEnds1
LineEnds2
LineEnds3
mWorldViewProj
MaxD
mWorldViewProj
MaxD
mWorldViewProj
MaxD
screenX
screenY
LineStarts0
LineStarts1
LineStarts2
LineStarts3
LineEnds0
LineEnds1
LineEnds2
LineEnds3
mWorldViewProj
MaxD
mWorldViewProj
MaxD
mWorldViewProj
MaxD
mWorldViewProj
mWorldViewProj2
LightPos <-- Error setting float array for HLSL variable
Any help on this one?

EDIT: it's working fine with EDT_OPENGL btw.

EDIT 2: fixed it by changing the following line in EffectCB.h

Code: Select all

services->setVertexShaderConstant("LightPos", reinterpret_cast<f32*>(&lightPosOS).X, 4);
to:

Code: Select all

services->setVertexShaderConstant("LightPos", reinterpret_cast<f32*>(&lightPosOS), 3);
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

Ah, nice find.

Some news on the Irrlicht implementation:

It's coming along nicely but you have to note some differences between the way XEffects and Irrlicht will work:

XEffects uses a single render target and renders multiple lights using a looping pass that renders the depth map and right after an additive shadow map overlay with the color of the light. This means that XEffects has both the shadowing and lighting responsibilities and that if something is not manually excluded from the scene it will be affected by this lighting also.

For the Irrlicht implementation it will be significantly different. It will render multiple lights into their own depth map in a previous pass and then do the shadow mapping as a transparent "darkening" layer with the ZBuffer intact, meaning it will only darken things and only the things that are supposed to receive shadows. I will probably restrict shadow receiving/casting to solid nodes at the start.

The main disadvantages/advantages of the 2 systems are:

XEffects:

Advantages:
- Because XEffects does the lighting also, it is capable of doing a realistic additive accumulative lighting system Basically it only shadows the color corresponding to the shadow casting light, and not everything, so you get realistic colored shadows (E.g. in the demo the RED light casts GREEN shadows and vice-versa).

- Only one shadow map for all lights (Less memory intensive).

Disadvantages:
- XEffects is more "intrusive", and needs to apply the lighting in a post process pass to the entire scene. This means that transparent scene nodes are difficult to render correctly and usually have to be excluded in some way from the scene's lighting. This also makes everything behind transparent scene nodes be free of lighting/shadows, which can look weird.

- It needs to re-use the same rendertarget in a loop, which can be bad for performance as the GPU has to wait for the previous pass to finish before it can continue with the next.

Irrlicht implementation:

Advantages:
- Faster because only shadow-receiving nodes have to be rendered and no lighting needs to be done (Only shadows).

- Keeps the ZBuffer from the scene intact so that the shadows only get drawn where they're supposed to be and reduces overdraw.

- Doesn't interfere with the rest of the scene so it's easy to use a lot of materials and transparency types and not have to manually exclude them.

- Much easier and straightforward to use.

- Will try to support point lights in the initial release or very soon after it, which will be a big improvement over XEffect's directional/spotlight only system.

- Probably a little faster because the GPU doesn't depend on a single shadow map when rendering the depth passes, therefore it can continue onto the next pass without waiting for the previous to finish.

Disadvantages:
- Only renders "Darkening" shadows with an ordinary color similar to the current stencil buffer system. This means no additive accumulative lighting.

- Multiple shadow maps so the memory usage is a bit higher.

This should about cover the differences. I want to have additive lighting in Irrlicht someday but it needs some thought about the lighting system, and for now I want to implement shadow maps without changing the interface so that it's easy for existing projects to switch between the shadow types.

Cheers
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
MikeDee
Posts: 35
Joined: Wed Nov 18, 2009 11:41 pm

Post by MikeDee »

Sounds great, any idea when will see Irrlicht's new version ?

Keep up the great work !
3DModelerMan
Posts: 1691
Joined: Sun May 18, 2008 9:42 pm

Post by 3DModelerMan »

Is this actually going into the Irrlicht SDK release?
That would be illogical captain...

My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
Post Reply