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

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
Virion
Competition winner
Posts: 2148
Joined: Mon Dec 18, 2006 5:04 am

Post by Virion »

wuallen wrote:Hi Virion, I look the picture, I feel that the cube and dwarf are not just right on the ground, there is a small gap between the ground and the cube or dwarf. It looks they fly in the air. May be this is the cause.
i'd checked this in the real-time demo but it's not floating above the ground.
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

@wuallen and Virion: I already explained what it is and how to fix it.

@doqkhanh: Your Irrlicht version is too old. If you don't want to update you can just comment any line that uses this function. (Make sure to modify the resolution selection in the example to a fixed size if you do this.)

Cheers
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
doqkhanh
Posts: 158
Joined: Sat Mar 01, 2008 3:14 am
Location: Tokyo, Japan
Contact:

Post by doqkhanh »

BlindSide wrote: @doqkhanh: Your Irrlicht version is too old. If you don't want to update you can just comment any line that uses this function. (Make sure to modify the resolution selection in the example to a fixed size if you do this.)
Hi, BlindSide!
The folder path is 1.4 but inside code is Irrlicht version 1.4.1.

At this time, I am at home now, and the error still there:

Code: Select all

Example.cpp
c:\3d\vhfos\vhfos\viet heroes - fight or surrender\example.cpp(151) : error C2039: 'getVendorInfo' : is not a member of 'irr::video::IVideoDriver'
        c:\3d\irrlicht 1.4.1\include\ivideodriver.h(76) : see declaration of 'irr::video::IVideoDriver'
c:\3d\vhfos\vhfos\viet heroes - fight or surrender\example.cpp(151) : error C2228: left of '.equals_ignore_case' must have class/struct/union
Build log was saved at "file://c:\3D\VHFOS\VHFOS\Viet heroes - Fight or Surrender\Debug\BuildLog.htm"
Viet Heroes - Fight or Surrender - 2 error(s), 1 warning(s)
========== Build: 0 succeeded, 1 failed, 2 up-to-date, 0 skipped ==========
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Yes, as said elsewhere, getVendorInfo is only part of SVN trunk, aka Irrlicht 1.5
But BlindSide already suggested to simply remove that line.
doqkhanh
Posts: 158
Joined: Sat Mar 01, 2008 3:14 am
Location: Tokyo, Japan
Contact:

Post by doqkhanh »

hybrid wrote:Yes, as said elsewhere, getVendorInfo is only part of SVN trunk, aka Irrlicht 1.5
But BlindSide already suggested to simply remove that line.
:shock: :cry: my GUI skin have problem with irrlicht 1.5 in svn truck...

To Hybid and BlindSide: Thank you very much.
iZigoo
Posts: 53
Joined: Fri Feb 23, 2007 1:32 pm

Post by iZigoo »

Hey,

i just downloaded the latest version !!

Great work BlindSide !!!

iZigoo

www.izigoo.com
-------------------------------------------------------
iZigoo - The open 3D internet

iZigoo Homepage
EvilAlex
Posts: 6
Joined: Fri Aug 29, 2008 12:02 am
Location: Moscow, Russia
Contact:

Post by EvilAlex »

Hi, guys!

I've tried to use this effect pack, and ran into some serious problems:
1) It doesn't work with Direct 3d on my machine at all (black screen, or lots of artifacts, or e.t.c.).
2) When working I've experienced that I can not make it work with pre-lightmapped surfaces (using OpenGL, as it doesn't work with D3d in my case)!

As OpenGL is even better for my project anyway, let's focus on the origins of the second problem.
I'm using a custom 3dWS level loader, which loads pre-built lightmaps, generated by the 3d World Studio software.

My loader loads lightmaps with EMT_LIGHTMAP_M4 flag, to make the last brighter (or the maps appears too dark). Obviously this doesn't work with this effect pack as it should, so I've got something like my map with EMT_SOLID all the way (shadows applied, thou), which looks like this:

Image
Ok, I've got shadows, that's pretty cool, by where is my lightmap?
I've changed to darker "EMT_LIGHTMAP" (without M4) to see if it'll work.

But whilst using Irrlicht 1.3.1 (the code of the effects is easily downgradeable for that version of IrrLicht) I've got this as a result:
Image
Lots of ugly squares in the place where a lightmap used to be.

And this, whilst using IrrLicht 1.4.1 (had to port over my entire code, which isn't easy):
Image
Much better than the squares, but still this isn't the lightmap!
This is something else.

The real lightmap for the area looks like this (shadow effect code is disabled for this screenshot):
Image
And here are some important marks:
Image
As you can see, there should be a pre-generated tree shadow, and a major (again, pre-rendered) light source nearby. None of which appeared on the upper screenshots.

I've started digging into the code in order to find the source of the problem, and I've found this:

Code: Select all

if(shadowNodeArray[i].materialTypes[0] == EMT_DETAIL_MAP || shadowNodeArray[i].materialTypes[0] == EMT_LIGHTMAP)
{
	switch(shadowNodeArray[i].filterType)
	{
	case EFT_NONE:
		shadowNodeArray[i].node->setMaterialType((E_MATERIAL_TYPE)Detail);
		break;
and this:

Code: Select all

				sPP->addShaderDefine("SAMPLE_AMOUNT",1);
				Detail = gpu->addHighLevelShaderMaterial(
					sPP->ppShaderFF(SDFNV).c_str(),	"vertexMain", video::EVST_VS_2_0,
					sPP->ppShaderFF(SDFNP).c_str(), "pixelMain", video::EPST_PS_2_0,
					mc1, video::EMT_DETAIL_MAP);
which effectively means, that, my material's type was effectively changed from EMT_LIGHTMAP into EMT_DETAIL_MAP-based type, which is incorrect by the definition of it (just how is the engine supposed to know, that there is a lightmap, then?).
So, I did some more digging and found out that this wasn't the true source of the problem.
I've changed the upper code to:

Code: Select all

				sPP->addShaderDefine("SAMPLE_AMOUNT",1);
				Detail = gpu->addHighLevelShaderMaterial(
					sPP->ppShaderFF(SDFNV).c_str(),	"vertexMain", video::EVST_VS_2_0,
					sPP->ppShaderFF(SDFNP).c_str(), "pixelMain", video::EPST_PS_2_0,
					mc1, video::EMT_LIGHTMAP);
And...
Guess what!
The result was the same as on picture 3!
Still no correct lightmap, just some random dark places instead.

I've read this topic, and saw a guy, who had similar problem.
The post was written by elvman and appears on page 7 of this topic.

So, can IrrLicht really mix material types, or not?
Because, in fact, I wanted to add parallax mapping and those nice shadows on top of it, so that question is the main here :lol:

Can anyone tell me how to get those shadows work with real lightmaps?
It would be very appreciated!

Thanks in advance! :wink:

Awesome work on the effects, b.t.w. :roll:
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

Your screenshots don't show, but I guess that's irrelevant, since all I need to know is that it's not working. I'm thinking of making this a multipass approach, seperating the color and lighting passes. This will effectively allow you to use any imaginable material alongside the shadow maps, even custom shader materials. It'll also allow a light screen based blur. I actually outlined this approach a few pages back, I may implement this in the wrapper later when I have time.
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
EvilAlex
Posts: 6
Joined: Fri Aug 29, 2008 12:02 am
Location: Moscow, Russia
Contact:

Post by EvilAlex »

BlindSide wrote:...I'm thinking of making this a multipass approach, seperating the color and lighting passes. This will effectively allow you to use any imaginable material alongside the shadow maps, even custom shader materials. It'll also allow a light screen based blur. I actually outlined this approach a few pages back, I may implement this in the wrapper later when I have time.
That would be very cool! :wink:
Hope to see this soon :D
fallingbrickwork
Posts: 52
Joined: Sun Jun 22, 2008 4:09 pm
Contact:

Post by fallingbrickwork »

I am implementing Xeffects Postprocessing into my project and have a query on multiple passes.

I have a scene with approx. 190 scene nodes, one of which gets 'highlighted' when the mouse rolls over. At present i'm purely changing this objects colour to show it is highlighted.

Is it possible to render all the objects AND THEN add post processing to a single mesh? (i thought a nice bloom/HDR would look more professional than just changing it's colour). How would Irrlicht handle two passes (generic code would be great to see)

Many thanks in advance...
Casus Belli - Realtime strategy war game
Image
wing64
Competition winner
Posts: 242
Joined: Wed Jul 23, 2008 2:35 am
Location: Thailand
Contact:

Post by wing64 »

XEffect work fine with OpenGL but when use D3D9 come with error

Code: Select all

HLSL vertex shader compilation failed:
error X3506: unrecognized compiler target 'vs_3_0'
i test on Geforce6100 and engine return true when use queryFeature(EVDF_VERTEX_SHADER_3_0).
Question is how should i fix above problem ?
best regards,
wing64
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

Crazy, sounds like your Irrlicht is compiled with such an old version of DX9 that it doesn't recognise VS 3.0. Are you using the precompiled binary?

@fallingbrickwork: Theres plenty of ways to achieve this effect. By far the easiest (If your object is solid) would be to use a shader on that object that outputs an alpha value of 0. The trick is, because this object is solid, and does not have a transparent base material applied, it will write a 0 alpha value but won't be invisible!

This allows you to mark certain objects, and then in the post processing pass just check for pixels with an alpha value of 0, and only blur/process those etc. Just be wary of using this on transparent objects (As they will go invisible), and also make sure your background clear colour, if that's visible, does not have an alpha value of 0 (Since this usually doesn't make a difference anyway, just set it to 255 fully opaque.).

For anyone experiencing trouble, or has inquiries/ideas about XEffects, (Or any other wrappers I've produced), I've opened up a support forum over at this place in an effort to reduce support queries in the Project Announcements forums and unclog my PM box.

Cheers
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
3DModelerMan
Posts: 1691
Joined: Sun May 18, 2008 9:42 pm

ummm

Post by 3DModelerMan »

Is there a software impementation of this?.
That would be illogical captain...

My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
yellowfever13
Posts: 34
Joined: Thu Aug 17, 2006 10:32 pm

Question

Post by yellowfever13 »

First of all this is a great set of tools!

I am experimenting with things, and my node when not lighted is completely black. Your demo scene looks alot better than my current scene!

How can I get some ambient light onto my node to show the texture when not directly lighted?

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

Post by BlindSide »

Fashizzle
Whats rollin my y-to-the-fizzle.

I haven't really though about practical things like ambient, etc I'm afraid. Even though there are alot of features and I have updated it many times, it is still in some ways in it's early stages I guess. I will definately add something like that in the next update. Thanks for the suggestion.

Oh yeah, so that makes the feature list for the next release:

- Multiple lights.
- Material independant shaders (Can have any materials in scene).
- Ambient lighting.

How would you like the ambient lighting to be set? Per light using the AmbientColor, or per object using the EmissiveColor?
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Post Reply