Nemo Krad

I have bought a book on shaders and have been going through the tutorials with some success.

However I now have a rather odd issue with my bumpmap shaders... I have three shaders, a bumpmap shader, a parallax bumpmap shader and a self shadowing bumpmap shader. My issue is that when I run my engine with the bumpmap shaders I get a rather odd effect happening, but (after many days of trying to sort this out) I found that if I run FX Composer prior to running my engine, this oddity seems to go away.

This leads me to think that FX Composer is setting some render states that I am not aware of and need to set for my bumpmap shaders. Is anyone able to let me know what render states I need to set or even if this is what is causing this odd behavior

My shaders before running FX Composer http://www.randomchaos.co.uk/XNA/Examples/before.jpg

My shaders as FX Composer is running http://www.randomchaos.co.uk/XNA/Examples/during.jpg

My shaders after FX Composer has ran http://www.randomchaos.co.uk/XNA/Examples/after.jpg

Here are the shaders:


Re: XNA Framework ODD Bumpmap issue

Shawn Hargreaves - MSFT

That is extremely peculiar! It ought not be possible for one app to affect the rendering of another, because renderstates are not shared between apps (unless there's a really nasty bug in your drivers).

You could try using PIX to capture a frame both when the rendering is correct and when it is broken, and then see what renderstates are different between the two.





Re: XNA Framework ODD Bumpmap issue

Nemo Krad

Shawn,

It is indeed odd, it has been giving me a headache for about a week now!

Forgive my ignorance but what is PIX and where can I get it to try this out

Thanks.





Re: XNA Framework ODD Bumpmap issue

Shawn Hargreaves - MSFT

PIX is part of the DirectX SDK. It lets you capture frames of your game, see exactly what render calls you issued, what renderstates are set, etc.





Re: XNA Framework ODD Bumpmap issue

Nemo Krad

Shawn,

I have ran PIX and captured the render state before and after FX Composer has been ran, I now have a shead load of data and don't know how to compare it other than going through it line by line. Is there a method to compare the two PIX Events without me trawling through them one line at a time

Thanks.





Re: XNA Framework ODD Bumpmap issue

Nemo Krad

Now this gets stranger....

I just took a look at the images in my PIX file and they both look fine Yet when I took the first snap shot the bump map rendering was all munched up like before, the second shot was after I ran FXC and the render was sorted out... yet the images in the PIX file are identical rendering....

I guess there is no need to trawl through the data in there now as it obviously sees the two dumps the same.

What could possibly be going on

I also logged off and back on to see if this would set the render back to it's initial state, but it did not I needed to either totally shut down and restart my PC or play around with FXC until it killed the render again. I could then get back to a good render state by just running FXC with without editing any thing other than the opening project it launches with.

Could this be down to me having a damaged copy of either FXC or GSE I have replaced r updated almost everything else other than the framework the and the IDE.

Anyone got any ideas

Thanks.





Re: XNA Framework ODD Bumpmap issue

Shawn Hargreaves - MSFT

This sounds very much like a graphics driver problem to me.





Re: XNA Framework ODD Bumpmap issue

Nemo Krad

Yes I agree.

The trouble with that is that I have renewed my drivers and now have the latest ones for my card and the issue persists...

I take it there is nothing else you can suggest





Re: XNA Framework ODD Bumpmap issue

Nemo Krad

OK, some progress, but could still do with a little help or even an explanation of what might be going on here.

my bumpmap shaders are using vs_2_0 and ps_2_0, if I render another mesh after this using vs_1_1 and ps_2_0, the image sorts it's self out. I think that is why FXC fixes the issue up until I render a bumpmap in it and it sends the render back to the munched up state.

So my work around is to ensure I have a draw call after all my bump mapping that uses a vs_1_1 VertexShader.

Can anyone shed any light on this, or is this the only way I can fix this

Thanks.





Re: XNA Framework ODD Bumpmap issue

Shawn Hargreaves - MSFT

That absolutely sounds like a driver problem. I don't know that there's anything you can do about that, assuming you have the latest drivers for your card, unfortunately.





Re: XNA Framework ODD Bumpmap issue

Nemo Krad

I thought as much...

Thanks for taking the time to take a look anyway. If I come across a definitive solution for this then I will post it here.

Thanks again.