XEffects - (Indoor Soft-Shadows + Post-Processing)

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
sp00n
Posts: 114
Joined: Wed Sep 13, 2006 9:39 am

Post by sp00n »

hi
about using your code:
in the example.cpp there is a commented strings for the terrain, if i do same as there i see only black screen
i think i must attach a lighnode to effect, but in your code there are onle GetLightNode (none SetLightNode), and there are SetLightPosition and SetLightTarget, but for any values it doesn't work:(

can you explain how to attach shadows to terrain?

Thanks
Vsk
Posts: 343
Joined: Thu Sep 27, 2007 4:43 pm

Post by Vsk »

I don't undestand pretty well but if you see in that commeted text there is a line that he set light off for terain. Did you try set it on?
sp00n
Posts: 114
Joined: Wed Sep 13, 2006 9:39 am

Post by sp00n »

i have a dynamic light (sun) in my scene and as i understood for the shadows i must attach LightCamera to my dynamic light, but when i do it with SetLightPosition/Target i have a crashes in my application (may be lightcamera isn't initialised i don't remember exactly, cause my code is home:) )
Killua
Posts: 8
Joined: Sun Jan 20, 2008 4:37 pm
Location: Barcelona
Contact:

Post by Killua »

This is very (VERY) nice, I'm sure it'll come useful in some future project.

Now as I see you've read the crysis paper how about SSAO. You already have a framework in place to render a depth texture, the rest is a sort of post processing pass, it's well described here http://rgba.scenesp.org/iq/computer/art ... o/ssao.htm
and alternatively Ysaneya proposes some nice approximation in his dev journal at gamedev.net, but I'm sure you already knew both.

Anyway this is prety great as it is, thanks!
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

Yes I do know both and I'm working on it right now :D

I've already integrated an easy to use post-processing facility into this wrapper that can stack effects one after the other. Just needs some tweaking.

@sp00n: Could you make a small test case without any irrelevant code (Just the terrain and some models) that showcases this problem. I would be happy to look at the code of this and sort out any problems you may have.

Cheers
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
jingquan
Posts: 222
Joined: Sun Aug 20, 2006 4:10 am
Contact:

Post by jingquan »

Yeah, jittering is the way to go. It'll look like really soft shadows when it's blurred, but I still perfer the noisier hard jitters. :D

I'd like to get SSAO working too but I can't find a decent tutorial that teaches fx or HLSL. Maybe I'm just lazy... :wink:
Virion
Competition winner
Posts: 2148
Joined: Mon Dec 18, 2006 5:04 am

Post by Virion »

Nice, I've tried it and it runs pretty fast on my... quadcore system +geforce 8800 :twisted:
jingquan
Posts: 222
Joined: Sun Aug 20, 2006 4:10 am
Contact:

Post by jingquan »

Virion wrote:Nice, I've tried it and it runs pretty fast on my... quadcore system +geforce 8800 :twisted:
I....want it.... :twisted:

Hows the SSAO going? I think there's some errors with my eye-rays and projections (again) and my attempts at solving them failed. :cry:
EDIT: Great stuff! I've seen your blog and noticed you've got your SSAO working. Waiting for it...

:)heers.
Halan
Posts: 447
Joined: Tue Oct 04, 2005 8:17 pm
Location: Germany, Freak City
Contact:

Post by Halan »

hi,

i was wondering if you plan to implent directional lighting too somewhen

greetings,
Halan
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

Directional can already be done pretty easily. Just create an orthogonal projection matrix using Matrix4::buildProjectionMatrixOrthoLH() and set this as the light camera's projection matrix using effect->getLightCamera()->setProjectionMatrix().

Piece of cake, huh? :wink:
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Scripter
Posts: 6
Joined: Mon Dec 17, 2007 3:20 pm

Post by Scripter »

Additional light sources
BlindSide wrote:Sorry that is difficult without editing the actual shader code, and also it is limited by hardware. For Shader model 3 it will be easy to have lots of lights though. Shader model 2 you can have a few lights but not over 4PCF quality.

Anyway this will require some small modifications to the shader.
Hi BlindSide, first of nice work with the shadow effects :D.
Im wondering if maybe u could add support for additional lightsources or give me some directions on where and what in the shaders to change(if that hasnt been added already, cant see anywhere in this post that it has).
This would be a nice feature for our project that im working on for school, we are making a game( can check it out at http://fuelinjected.se ).
Thx for the help
vectorcorpse
Posts: 86
Joined: Thu Feb 14, 2008 7:30 pm
Location: Portugal

Post by vectorcorpse »

hi.
1st of all, congratz for the nice work.
i am trying to compile u'r example program in linux, and since u don't include a make file i tryed to create one based on the make files from the irrlicht examples, and it is giving out some errors and i am not shure what am i doing wrong.
heres how the make file looks like:
# Makefile for Irrlicht Examples

# It's usually sufficient to change just the target name and source file list

# and be sure that CXX is set to a valid compiler

Target = xeffects


Sources = Example.cpp



# general compiler settings

CPPFLAGS = -I../../include -I/usr/X11R6/include

CXXFLAGS = -O3 -ffast-math

#CXXFLAGS = -g -Wall



#default target is Linux

all: all_linux



ifeq ($(HOSTTYPE), x86_64)

LIBSELECT=64

endif



# target specific settings

all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht -lGL -lXxf86vm -lXext -lX11

all_linux clean_linux: SYSTEM=Linux

all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lm

all_win32 clean_win32: SYSTEM=Win32-gcc

all_win32 clean_win32: SUF=.exe

# name of the binary - only valid for targets which set SYSTEM

DESTPATH = ../../bin/$(SYSTEM)/$(Target)$(SUF)



all_linux all_win32:

$(warning Building...)

$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(Sources) -o $(DESTPATH) $(LDFLAGS)



clean: clean_linux clean_win32

$(warning Cleaning...)



clean_linux clean_win32:

@$(RM) $(DESTPATH)



.PHONY: all all_win32 clean clean_linux clean_win32

and here is the error it is giving:

Makefile:30: Building...
g++ -I../../include -I/usr/X11R6/include -O3 -ffast-math Example.cpp -o ../../bin/Linux/xeffects -L/usr/X11R6/lib -L../../lib/Linux -lIrrlicht -lGL -lXxf86vm -lXext -lX11
CShaderPre.h:10: error: extra qualification ‘CShaderPreprocessor::’ on member ‘removeShaderDefine’
make: *** [all_linux] Error 1


i tryed to comment line 10 with void CShaderPreprocessor::removeShaderDefine(const irr::core::stringc name); in Cshaderpre.h to see if i could understand what was going on and the error it gives after that is this:

Makefile:30: Building...
g++ -I../../include -I/usr/X11R6/include -O3 -ffast-math Example.cpp -o ../../bin/Linux/xeffects -L/usr/X11R6/lib -L../../lib/Linux -lIrrlicht -lGL -lXxf86vm -lXext -lX11
/tmp/ccGU9V01.o: In function `main':
Example.cpp:(.text+0x332): undefined reference to `effectHandler::effectHandler(irr::IrrlichtDevice*, irr::core::dimension2d<int>)'
Example.cpp:(.text+0x4aa): undefined reference to `effectHandler::addShadowToNode(irr::scene::ISceneNode*, E_FILTER_TYPE)'
Example.cpp:(.text+0x6b7): undefined reference to `effectHandler::addShadowToNode(irr::scene::ISceneNode*, E_FILTER_TYPE)'
Example.cpp:(.text+0x813): undefined reference to `effectHandler::setMaxShadowDistanceFromLight(unsigned int)'
Example.cpp:(.text+0x9db): undefined reference to `effectHandler::addEffectToNode(irr::scene::ISceneNode*, E_EFFECT_TYPE)'
Example.cpp:(.text+0x9e6): undefined reference to `effectHandler::addNodeToDepthPass(irr::scene::ISceneNode*)'
Example.cpp:(.text+0x9f6): undefined reference to `effectHandler::setShadowDarkness(float)'
Example.cpp:(.text+0xae2): undefined reference to `effectHandler::update()'
Example.cpp:(.text+0xb8a): undefined reference to `effectHandler::addEffectToNode(irr::scene::ISceneNode*, E_EFFECT_TYPE)'
Example.cpp:(.text+0xb95): undefined reference to `effectHandler::addNodeToDepthPass(irr::scene::ISceneNode*)'
Example.cpp:(.text+0xbaa): undefined reference to `effectHandler::addEffectToNode(irr::scene::ISceneNode*, E_EFFECT_TYPE)'
collect2: ld returned 1 exit status
make: *** [all_linux] Error 1

now, i admit i am newbie to irr programing so pls don't hit me too hard because of the question. :P
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

You just have to remove the class name before the :: (including the ::).
vectorcorpse
Posts: 86
Joined: Thu Feb 14, 2008 7:30 pm
Location: Portugal

Post by vectorcorpse »

is this the line or did i changed the wrong one?
i changed the line:
void CShaderPreprocessor::removeShaderDefine(const irr::core::stringc name);
to:
void removeShaderDefine(const irr::core::stringc name);
but the result is the same error has comenting the entire line !!!!

Makefile:30: Building...
g++ -I../../include -I/usr/X11R6/include -O3 -ffast-math Example.cpp -o ../../bin/Linux/xeffects -L/usr/X11R6/lib -L../../lib/Linux -lIrrlicht -lGL -lXxf86vm -lXext -lX11
/tmp/ccgR1Y1W.o: In function `main':
Example.cpp:(.text+0x332): undefined reference to `effectHandler::effectHandler(irr::IrrlichtDevice*, irr::core::dimension2d<int>)'
Example.cpp:(.text+0x4aa): undefined reference to `effectHandler::addShadowToNode(irr::scene::ISceneNode*, E_FILTER_TYPE)'
Example.cpp:(.text+0x6b7): undefined reference to `effectHandler::addShadowToNode(irr::scene::ISceneNode*, E_FILTER_TYPE)'
Example.cpp:(.text+0x813): undefined reference to `effectHandler::setMaxShadowDistanceFromLight(unsigned int)'
Example.cpp:(.text+0x9db): undefined reference to `effectHandler::addEffectToNode(irr::scene::ISceneNode*, E_EFFECT_TYPE)'
Example.cpp:(.text+0x9e6): undefined reference to `effectHandler::addNodeToDepthPass(irr::scene::ISceneNode*)'
Example.cpp:(.text+0x9f6): undefined reference to `effectHandler::setShadowDarkness(float)'
Example.cpp:(.text+0xae2): undefined reference to `effectHandler::update()'
Example.cpp:(.text+0xb8a): undefined reference to `effectHandler::addEffectToNode(irr::scene::ISceneNode*, E_EFFECT_TYPE)'
Example.cpp:(.text+0xb95): undefined reference to `effectHandler::addNodeToDepthPass(irr::scene::ISceneNode*)'
Example.cpp:(.text+0xbaa): undefined reference to `effectHandler::addEffectToNode(irr::scene::ISceneNode*, E_EFFECT_TYPE)'
collect2: ld returned 1 exit status
make: *** [all_linux] Error 1

it looks like the 1st error was something else and probably solved with what u sugested and this error to be for some other reason :/
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

You have to add the effectHandler to your source files. Either add the cpp file to the sources, or use it precompiled and only link in.
Post Reply