Horde3D http://horde3d.org/forums/ |
|
Solution for problems with Knight sample http://horde3d.org/forums/viewtopic.php?f=3&t=156 |
Page 1 of 1 |
Author: | marciano [ 29.07.2007, 22:08 ] |
Post subject: | Solution for problems with Knight sample |
Some people have reported that the Knight sample doesn't work on older cards or drivers. The reason for this is that the postprocessing shader is using a for-loop which is not supported on all hardware. Here is a quick fix for the postprocessing.shader.xml file: Code: <Shader>
<Context id="RADIALBLUR"> <RenderConfig writeDepth="false" /> <VertexShader> <DefCode> <![CDATA[ void main( void ) { gl_TexCoord[0] = gl_MultiTexCoord0; gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; } ]]> </DefCode> </VertexShader> <FragmentShader> <DefCode> <![CDATA[ uniform sampler2D buf0; uniform vec4 radblurParams; void main( void ) { vec4 sum = vec4( 0, 0, 0, 0 ); vec2 coord = gl_TexCoord[0].xy; vec2 distToCenter = vec2( 0.5, 0.5 ) - coord; // Unrolled loop (for older cards like Radeon 9600) sum += texture2D( buf0, coord ); coord += distToCenter * radblurParams.x; sum += texture2D( buf0, coord ); coord += distToCenter * radblurParams.x; sum += texture2D( buf0, coord ); coord += distToCenter * radblurParams.x; sum += texture2D( buf0, coord ); coord += distToCenter * radblurParams.x; gl_FragColor = sum / 4.0; } ]]> </DefCode> </FragmentShader> </Context> </Shader> |
Page 1 of 1 | All times are UTC + 1 hour |
Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |