Page 29 of 56

Posted: Wed Nov 18, 2009 11:01 pm
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.

Posted: Thu Nov 19, 2009 1:34 am
by MikeDee
edit: nevermind fixed my problem. :D

Fantastic work there, congratulations ! :wink:

Posted: Fri Nov 20, 2009 11:38 pm
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.

Posted: Sat Nov 21, 2009 6:55 am
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.

Posted: Sat Nov 21, 2009 2:53 pm
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.

Posted: Sat Nov 21, 2009 2:59 pm
by 3DModelerMan
I'm also getting: ERROR cannot set render target.

Posted: Sun Nov 22, 2009 11:09 am
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

Posted: Mon Nov 23, 2009 2:57 am
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.

Posted: Mon Nov 23, 2009 1:26 pm
by IrrDelphi
BlindSide, good work! But i can't understand. Why XEFFECT not integrated into irrlicht library?

Posted: Mon Nov 23, 2009 3:16 pm
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.

Posted: Fri Nov 27, 2009 7:03 am
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.

Posted: Sat Nov 28, 2009 8:02 pm
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);

Posted: Sun Nov 29, 2009 8:55 am
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

Posted: Sun Nov 29, 2009 3:01 pm
by MikeDee
Sounds great, any idea when will see Irrlicht's new version ?

Keep up the great work !

Posted: Mon Nov 30, 2009 1:09 am
by 3DModelerMan
Is this actually going into the Irrlicht SDK release?