Shader problem combining components in scene

Started by
3 comments, last by Paul Ward 9 years, 8 months ago

Well, as they say ... a picture explains a thousand words so here goes.

I'm trying to understand why despite my pixel shader being set (as you can see in the timeline of calls on the left) along the bottom the pixel shader part of the pipeline is missing resulting in no output.

sHh0P.png

I have 2 components in my scene (a hud component using awesomuim and a voxel based terrain component).

Both have been tested on their own and work to render the expected output but when combining them I get the hud when the scene is done but no terrain.

It gets even stranger too ...

The mesh info shown here appears to be correct but if i move the camera around I can see that the terrain did clearly make it on to the scene but appears to have gotten "mangled" in some way.

I think it looks something to do with my transforms somehow but none of the code between these 2 components is shared including the transforms so how 1 component is affecting the other is beyond me.

Does anyone have any ideas how I can go about tracking this down?

If I move the camera a bit I get something like this ...

Zvo6C.png

Advertisement

shaderprob.png -> bad link.

Please don't PM me with questions. Post them in the forums for everyone's benefit, and I can embarrass myself publicly.

You don't forget how to play when you grow old; you grow old when you forget how to play.

Sorry about that ... should be fixed now.

Just an observation (may not have anything to do with the problem): it may just be your coding style, but you update resources after you set them. I.e., PSSetShaderResource(...); UpdateSubresource(...);

Are you just anticipating the next PSSetShaderResource, or do you have any of those out of order? E.g., you don't update the pixel resource(s) before your first call.

Please don't PM me with questions. Post them in the forums for everyone's benefit, and I can embarrass myself publicly.

You don't forget how to play when you grow old; you grow old when you forget how to play.

Yeh it's an optimisation point ...

Essentially the first thing that happens is the resource is created then per object I do a set then a draw call.

It's for things like world view projections as each object has its own unique values.

We only just implemented the shader batching and its not solving all cases just yet but its not far off !!!

On the up side I fixed the problem ...

I turns out that my team mate had managed to declare his own constant buffer which he was overwriting my constant buffer with then never using it because the buffer only contains the wvp matrix for the current renderable object and he was rendering in 2d space for the hud code.

once I ripped that out it all sprang to life.

Been battling this for a few days now ... awesome that I have it fixed but annoying I had to go dig through the hud code to get my fix.

Never mind !!!

This topic is closed to new replies.

Advertisement