Jump to content

  • Log In with Google      Sign In   
  • Create Account


Fx Shader weird Culling Issue


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
7 replies to this topic

#1 TheOrestes   Members   -  Reputation: 236

Like
0Likes
Like

Posted 09 April 2012 - 12:56 AM

Hi,

Am facing weird culling issue with My post processing shader. Right now, Post processing shader does nothing but draws the scene as it is on the screen space aligned quad with back buffer surface as a texture.

To my surprise, the real problem is with weird culling issue that is occuring only on the nvidia cards. Everything works fine when demo is run on ati cards. Attached is the screenshots for both the cards. I tried setting cullmode to all 3 modes both inside CPP code & in shader technique as well, but am unable to figure out real cause for the problem.

Attached is the basic shader code for post process setup.
// Global Shader Variables
texture gScreenTexture;[/font]
[font=courier new,courier,monospace]// Samplers
sampler screenSampler = sampler_state
{
	Texture = <gScreenTexture>;
	MinFilter = LINEAR;
	MagFilter = LINEAR;
	MipFilter = LINEAR;
	AddressU = WRAP;
	AddressV = WRAP;
};[/font]
[font=courier new,courier,monospace]/////////////////////////////////////////////////////////////////////[/font]
[font=courier new,courier,monospace]// The vertex shader does not do any transformation, coordinates
// are allready in clipping space.
VS_OUTPUT VS( float4 Pos:POSITION,  float2 Tex:TEXCOORD0 )
{
	VS_OUTPUT output = (VS_OUTPUT)0;
	output.Pos=Pos;
	output.Tex = Tex;
	return output;
}[/font]
[font=courier new,courier,monospace]// Default
float4 PS(VS_OUTPUT pIn):COLOR0
{
	float4 rgb = tex2D ( screenSampler, pIn.Tex);
	return rgb;
}[/font]
[font=courier new,courier,monospace]/////////////////////////////////////////////////////////////////////
// tecnique name needs to correspond to the value passed
// to the GetTechniqueByName method
technique Default
{
	pass p0
	{
		VertexShader = compile vs_3_0 VS();
		PixelShader = compile ps_3_0 PS();
	}
}


I can be rest assured that setup required for the Post processing is done in the correct way using DirectX. Screenshots for all post processing effects achieved so far on ATI cards can be seen on this blog of mine : http://rupeshmandke.blogspot.in/

Any guidance will be much appreciated.

Thanks,
rmandke.

Attached Thumbnails

  • ati.jpg
  • nvidia1.jpg
  • nvidia2.jpg


Sponsor:

#2 MJP   Moderators   -  Reputation: 8757

Like
0Likes
Like

Posted 09 April 2012 - 02:38 AM

Do you have the debug runtimes enabled? You can turn it on from the DirectX control panel.

#3 TheOrestes   Members   -  Reputation: 236

Like
0Likes
Like

Posted 09 April 2012 - 03:40 AM

Do you have the debug runtimes enabled? You can turn it on from the DirectX control panel.


Hi,

Yes, I do have debug runtimes enabled. It gives me warning about "Ignoring redundant SetSamplerState", something like :

Direct3D9: (WARN) :Ignoring redundant SetSamplerState Sampler: 0, State: 13

Direct3D9: (WARN) :Ignoring redundant SetSamplerState Sampler: 0, State: 14

Direct3D9: (WARN) :Ignoring redundant SetSamplerState Sampler: 0, State: 25

Direct3D9: (WARN) :Ignoring redundant SetSamplerState Sampler: 0, State: 15

Direct3D9: (WARN) :Ignoring redundant SetSamplerState Sampler: 0, State: 16

Direct3D9: (WARN) :Ignoring redundant SetSamplerState Sampler: 0, State: 17

Direct3D9: (WARN) :Ignoring redundant SetSamplerState Sampler: 0, State: 18

Direct3D9: (WARN) :Ignoring redundant SetSamplerState Sampler: 0, State: 19

Direct3D9: (WARN) :Ignoring redundant SetSamplerState Sampler: 0, State: 20

Direct3D9: (WARN) :Ignoring redundant SetSamplerState Sampler: 0, State: 21

Direct3D9: (WARN) :Ignoring redundant SetSamplerState Sampler: 0, State: 29

Direct3D9: (WARN) :Ignoring redundant SetSamplerState Sampler: 0, State: 30

Direct3D9: (WARN) :Ignoring redundant SetRenderState - 8

Direct3D9: (WARN) :Ignoring redundant SetRenderState 8

Direct3D9: (WARN) :Ignoring redundant SetSamplerState Sampler: 0, State: 13

Direct3D9: (WARN) :Ignoring redundant SetSamplerState Sampler: 0, State: 14

Direct3D9: (WARN) :Ignoring redundant SetSamplerState Sampler: 0, State: 25

Direct3D9: (WARN) :Ignoring redundant SetSamplerState Sampler: 0, State: 15

Direct3D9: (WARN) :Ignoring redundant SetSamplerState Sampler: 0, State: 16

Direct3D9: (WARN) :Ignoring redundant SetSamplerState Sampler: 0, State: 17

Direct3D9: (WARN) :Ignoring redundant SetSamplerState Sampler: 0, State: 18

Direct3D9: (WARN) :Ignoring redundant SetSamplerState Sampler: 0, State: 19

Direct3D9: (WARN) :Ignoring redundant SetSamplerState Sampler: 0, State: 20

Direct3D9: (WARN) :Ignoring redundant SetSamplerState Sampler: 0, State: 21

Direct3D9: (WARN) :Ignoring redundant SetSamplerState Sampler: 0, State: 29

Direct3D9: (WARN) :Ignoring redundant SetSamplerState Sampler: 0, State: 30

Direct3D9: (WARN) :Ignoring redundant SetRenderState - 8

Direct3D9: (WARN) :Ignoring redundant SetRenderState 8

Direct3D9: (WARN) :Ignoring redundant SetSamplerState Sampler: 0, State: 13

Thanks for the quick reply though .. Please guide me in how i can debug this issue. The problem is somehow specific only on nvidia cards Posted Image

#4 TheOrestes   Members   -  Reputation: 236

Like
0Likes
Like

Posted 11 April 2012 - 07:17 AM

Hi,

Anyone has any information on this issue? Has anyone ever faced such weird culling issues?
Any help would be appreciable Posted Image

#5 jischneider   Members   -  Reputation: 252

Like
0Likes
Like

Posted 11 April 2012 - 08:00 AM

This shader looks fine. I want to see the shader that draws the dwarf and the code that calls this shader.

Or better yet, upload the example and I can execute it in my machine (I have an NVIDIA car, a GeForce 560Ti). This could help to find driver problems or something similar.

Bye.

Ps: I don’t have antivirus (never had), so no virus please.

Project page: < XNA FINAL Engine >


#6 TheOrestes   Members   -  Reputation: 236

Like
0Likes
Like

Posted 10 July 2012 - 10:50 AM

Hi jischeider,

I just lost this thread. Can you mail me your personal mail id so that i can mail you the code?
Please message me your mail id :)

Regards.

#7 jischneider   Members   -  Reputation: 252

Like
0Likes
Like

Posted 10 July 2012 - 10:53 AM

Ok. I removed my mail from here. I don't want too much spam.

Project page: < XNA FINAL Engine >


#8 TheOrestes   Members   -  Reputation: 236

Like
0Likes
Like

Posted 09 September 2012 - 08:16 AM

Hi Guys,

First of all thanks a lot for giving attention to my problem. I was not able to look at the problem till today, when i decided to give PIX a final shot! And guess what! I have solved the mystery ...hmm.. maybe partially, I mean am getting the desired output right now, no weird culling issue anymore on nvidia card :)
Solution? Well, I had this in the device creation code :
d3dpp.MultiSampleType = D3DMULTISAMPLE_2_SAMPLES;
I changed it to D3DMULTISAMPLE_NONE & the problem was resolved! how i got this idea? So, i started debugging using PIX for single frame capture, to my surprise whenever i tried debugging the frame I used to get warning saying multisampling is ON, would you like to turn it OFF in order to match the output to rendertarget? I was constantly saying yes / no randomly without actually reading the warning completely.

Later on, to my suprise, I noticed that everytime i turned OFF multisampling output in rendertarget used to be correct i.e. without weird culling issues, when i discarded the warning I used to get renderbuffer with problematic output.
So, I just went back & did the changes! & whoila!!! But still not able to really understand as how the problem has been mitigated though. DirectX doc says, multisampling to be used only when
d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD; not otherwise.

I had this in my code & still have it. But the problem is gone with disabling multisampling only.
Any idea on this one? It will make me happier if i know the complete reason :)

Cheers,
TheOrestes.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS