Moderators: Moderators, OGRE Team





DWORD wrote:Hm, the GL version is the right one. It looks like the DX version ignores the depth completely and just blurs everything.On my 6800 it looks identical on GL and DX, so I don't know what could be wrong. Updated drivers?
raflegan wrote:Do you get any exceptions in Ogre.log concerning the vertex or fragment shaders?
22:29:03: Error in material Examples/Robot at line 617 of Example.material: Invalid vertex_program_ref entry - vertex program Ogre/HardwareSkinningOneWeight has not been defined.
22:29:03: Error in material Examples/Robot at line 629 of Example.material: Invalid shadow_caster_vertex_program_ref entry - vertex program Ogre/HardwareSkinningOneWeightShadowCaster has not been defined.
22:29:03: Error at line 677 of Example.material: Error in program Examples/GrassWaverVp parameter entry_point is not valid.
22:29:03: Error at line 677 of Example.material: Error in program Examples/GrassWaverVp parameter profiles is not valid.
22:29:03: Error in material Examples/HardwareMorphAnimation at line 764 of Example.material: Invalid vertex_program_ref entry - vertex program Ogre/HardwareMorphAnimation has not been defined.
22:29:03: Error in material Examples/HardwarePoseAnimation at line 799 of Example.material: Invalid vertex_program_ref entry - vertex program Ogre/HardwarePoseAnimation has not been defined.raflegan wrote:The DoF_DepthOfField_hlsl.frag shader has to be compiled to ps_3_0 in DirectX, does your card support pixel shader 3.0?
DepthOfFieldEffect *DOFE = new DepthOfFieldEffect(viewPort);uniform float2 pixelSizeScene; // pixel size of full resolution image
uniform float2 pixelSizeBlur; // pixel size of downsampled and blurred image
float4 main(float2 tex : TEXCOORD0) : COLOR0
{
return float4(1.0,pixelSizeScene.r,pixelSizeBlur.r,1.0);
}#include <OgreLogManager.h>
LogManager::getSingleton().logMessage("text");raflegan wrote:You could also try to test very simple shaders, to see if something is wrong with the hlsl shaders, e.g. rewrite the DoF_DepthOfFiel_hlsl.frag shader to:
- Code: Select all
uniform float2 pixelSizeScene; // pixel size of full resolution image
uniform float2 pixelSizeBlur; // pixel size of downsampled and blurred image
float4 main(float2 tex : TEXCOORD0) : COLOR0
{
return float4(1.0,pixelSizeScene.r,pixelSizeBlur.r,1.0);
}
(You have to use pixelSizeScene and pixelSizeBlur in the output, otherwise the compiler would optimize them away)
If you get a red screen, then this shader is causing the problems, otherwise it is probabely not this shader causing the problem (or at least not only this shader).
void DepthOfFieldEffect::addCompositor()
{
// Add the compositor to the viewport
mCompositor = CompositorManager::getSingleton().addCompositor(
mViewport, "DoF_Compositor");
// Register 'this' as a listener
mCompositor->addListener(this);
}




fragment_program DoF_DepthOfFieldFP_HLSL hlsl
{
source DoF_DepthOfField_HLSL.frag
entry_point main
target ps_2_b
}



Users browsing this forum: TeaBag and 13 guests