Page 4 of 56

Posted: Wed Oct 29, 2008 11:26 pm
by sudi
Hey did u notice that xeffects does not work with IrrlichtSVN?
It compiles fine and there are no error messages from ur lib but there are simply no shadows.

Posted: Thu Oct 30, 2008 1:34 am
by timetokill
Wow! This is amazing!

I love the framework you've set up too, using an effect handler for all post-processing and shaders. I wasn't really sure how I was going to include shaders (if at all) into my project, but now I think I'll use your setup. Let's see how it goes :D

Posted: Thu Oct 30, 2008 12:09 pm
by timetokill
Tried to get it to work, with no luck :(

I'm using 1.4.1 (Edit: just switched to 1.4.2, problem i was having with it earlier disappeared) and a GeForce 7950 on Windows XP, and I am using Direct3D9.

I'm also getting the "screen size" issue. I'll try compiling with vi-wer's RenderTarget XXL as you suggested.

The other issue I'm getting is this:

"HLSL pixel shader compilation failed:
error X3539: ps_1_x is no longer supported; use /Gec in fxc to automatically upgrade to ps_2_0"

Do I actually need to download fxc? I'm not too familiar with shaders so I'm not sure what I'm supposed to do here :(

Posted: Thu Oct 30, 2008 5:11 pm
by BlindSide
The shader compile error won't affect the shadows, only the phong, wobbly, etc effects, so it should be fine (The effects suck anyway).

Does it work fine with a 512x512 size?

@ Sudi, I just tried it here and there are no problems. Maybe it is fixed already? Can you provide more info, I am guessing this is in OpenGL? Does it happen in both drivers?

Posted: Thu Oct 30, 2008 9:13 pm
by dlangdev
Any plans on writing a custom bump DOT3 shader soon?

Maybe I can write one up and see how it goes.

Let me know if this will work or not.

I'm referring to effecthandler::addEffectToNode(), tho.

Posted: Fri Oct 31, 2008 12:20 am
by timetokill
BlindSide wrote:The shader compile error won't affect the shadows, only the phong, wobbly, etc effects, so it should be fine (The effects suck anyway).

Does it work fine with a 512x512 size?
I've been trying with 512x512, no luck there. It keeps saying it's trying to render to a target larger than the screen. For reference, the window of the game I'm running is 1138x640. I've tried more normal sizes (like 800x600) but it didn't fix it either.

Glad to hear about the shader compile thing. So is what happened that the shaders were compiled with an old shader model, and have to be updated? Am I grasping that right?

Posted: Fri Oct 31, 2008 10:03 am
by BlindSide
Oh yeah, that's right, depending on your graphics card, and whether you are using Direct3D or not, you may have to change the 4th constructor parameter to (512, 512). This may not look good but Irrlicht is getting large RTT support in Direct3D very very soon apparently, if you don't want to wait you can apply the large rtt patch too. Theres not much I can do about that from my end.

Cheers

Posted: Fri Oct 31, 2008 11:42 am
by timetokill
Thanks Blindside, I really appreciate the frequent help :) I'm sorry to keep hounding you like this. :oops:

I did what you said and it actually ran this time, which is nice. Everything is pretty dark but I think I can figure that part out. Things are definitely looking very strange in my scene though... things being transparent and so on.

I do have another issue that could be affecting things: I get a constant "Error setting float array for HLSL variable" no matter what. I'm not sure what's causing it. Also, if I try to use a postprocessing effect (like BlurHP.glsl or BlurHP.hlsl) then all I get to see is the lovely background orange color :( I also had to do the "PS_2_a" and "VS_2_a" trick I saw on a previous page because it was having issues with shader 3_0.

I added a shadow light and did all the other stuff the tutorial suggested, with addShadowToNode and so on. I'm happy now that I at least can see some things rendering, even if they're incredibly dark. I'll try and fix those problems. In the meantime, do you have any other ideas on what could be causing problems?

Again, thanks so much for your help. :)

Posted: Fri Oct 31, 2008 12:02 pm
by BlindSide
You might want to update your NVidia drivers, a 7950 should have absolutely no trouble displaying this, it runs perfectly well on my Geforce 6200/6800 I use to develop it on. I also test it on an AMD laptop Radeon 200M for ATI/AMD support.

Does the demo behave fine in OpenGL btw? Oh yeah, and paste in the complete "Error setting float array for HLSL variable" error if you can, I'd like to see whats causing this. The random transparent stuff is probably just the phong style effects that failed to compile.

Posted: Fri Oct 31, 2008 12:30 pm
by timetokill
Hi Blindside,

I'm currently updating my Nvidia drivers, I'll let you know how that turns out. I'm guessing you're probably right about the phong effects, should I try to address that somehow?

Also, the error is literally: "Error setting float array for HLSL variable"
That line is copy+pasted from my output window. It prints it out every frame, too.

I'm about to restart my computer and test the updated drivers, I'll be back shortly :) I'll give a test to OpenGL too, but I was having issues with OpenGL (unrelated to XEffects, don't worry!) before so those issues may still be lingering.


UPDATE: Okay, after updating the drivers, I ran it again, and now most of my scene isn't there :shock: The moving billboard and the skybox are there, but all of my meshes are invisible.

However!!

On a brighter note, I ran it with Open_GL and it ran swimmingly! It didn't get the float setting error either... I'm really conflicted over it now, because I think I'd rather use Direct3D9 but I can't seem to get it working correctly :) However, I'm glad to say it definitely looks like it's not a lost cause, and it's related to my Direct3D setup.

Any ideas on how to jump that particular hurdle? :) Thanks again, I'm so excited to see any of this running! A few hours ago I thought it would never happen :lol:

Posted: Fri Oct 31, 2008 3:14 pm
by Mel
Okay, for all those who have the trouble of the RTT size (In directX, i haven't found the equivalent for OPEN GL) there is a patch here which enables you to use arbitrary size of the RTT texture.

It is for the 1.4 beta, but it works just fine for the current 1.4.2. I have tested it, and these are the results :)

This is the patch -> http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=24255

Unika+Xeffects postpro

Image

They work. Other thing is the shadows that won't appear O.OU probably i'm doing something wrong XD

Posted: Fri Oct 31, 2008 3:29 pm
by Virion
*shiny* *shiny* 8)

Posted: Fri Oct 31, 2008 4:15 pm
by Mel
Hehe! yes, it is the bloom shader, by Blindside, though a bit tweaked so it is NOT that shiny :shock:

Speaking of... a nice characteristic that Xeffects might have is the ability to make a bloom effect on a per material basis. That would be a great adition.Dunno if it is possible, but it would be an easy way to make glowing effects without having to mess too much with the rendering engine, or the like...

Posted: Fri Oct 31, 2008 6:22 pm
by dlangdev
It would be nice to see a render close-to or similar to a Final Fantasy render, tho. XEffects has some serious potential going that direction.

Posted: Sat Nov 01, 2008 7:44 am
by BlindSide
The included bloom shader sucks, frankly. It was really just an example of how easy it is to add a post processing effect to XEffects. When I have time after the exams I think I will add better bloom and maybe some DOF, etc.

For the shadows you have to be really careful with stuff like the far/near values for the shadow lights, basically you have to make sure everything that you want lit is within the light's frustum. This can be hard to get right if your games "units" are different from the example provided, the appropriate far value can be anywhere from 10000 to 0.1. I would start with something like 1000 and if that works (Or atleast you see *something* that may resemble a shadow) then go lower until it *just* covers everything, because the lower it is, the more accurate it is and less artifacts will appear.

Cheers