Depth of Field demo release

A place to show off your latest screenshots and for people to comment on them. Only start a new thread here if you have some nice images to show off!
Skorpio
Kobold
Posts: 37
Joined: Sun Sep 24, 2006 9:32 am

More info about my crash

Post by Skorpio »

The Ogre.log shows this:
10:30:32: Can't assign material Test_Plain to SubEntity of Test_Plain because this Material does not exist. Have you forgotten to define it in a .material script?
10:30:32: Can't assign material Test_StaticVertexProgram to SubEntity of Test_StaticVertexProgram because this Material does not exist. Have you forgotten to define it in a .material script?
10:30:32: Can't assign material Test_AnimatedVertexProgram to SubEntity of Test_AnimatedVertexProgram because this Material does not exist. Have you forgotten to define it in a .material script?
It seems it can't find Test_Plain for some reason. The obvious files are there.


The ogreleaks.log shows

----------------------------------------------------------------------------------------------------------------------------------
| Memory leak report for: 09/24/2006 10:30:36 |
----------------------------------------------------------------------------------------------------------------------------------


8291 memory leaks found:

Alloc. Addr Size Addr Size BreakOn BreakOn
Number Reported Reported Actual Actual Unused Method Dealloc Realloc Allocated by
------ ---------- ---------- ---------- ---------- ---------- -------- ------- ------- ---------------------------------------------------
000013 0x00B8C780 0x0000015C 0x00B8C770 0x0000017C 0x00000000 new N N exampleapplication.h(75) ExampleApplication::setup
000014 0x00B8C938 0x00000030 0x00B8C928 0x00000050 0x00000000 new N N ??(0) ??
000015 0x00B8C9C8 0x00000030 0x00B8C9B8 0x00000050 0x00000000 new N N ??(0) ??
000016 0x00B8CA58 0x00000014 0x00B8CA48 0x00000034 0x00000000 new N N ??(0) ??
000017 0x00B8CAC8 0x00000014 0x00B8CAB8 0x00000034 0x00000000 new N N ??(0) ??
000018 0x00B8CB38 0x00000020 0x00B8CB28 0x00000040 0x00000000 new N N ogreroot.cpp(144) Ogre::Root::Root
... this is just a portion of the memory leaks.


thanks
valtovar
Kobold
Posts: 30
Joined: Sat Sep 24, 2005 1:06 am

Post by valtovar »

i have the same error, when i compile, all fine, but when i try to run it break :'(.

I use:
Dagon 1.2
dof 0.1.4 (last)

i change target to ps_2_b but it's same.

I have Ati 9550
elenar
Gnoblar
Posts: 1
Joined: Tue Oct 17, 2006 2:35 pm

Post by elenar »

Hi,

Tried to compile the code with the little change made to support only pixelshader 2.b (my graphic card doesn't support ps 3.0).

I took the binary 0.1.4, the src files of 0.1.4, the latest ogre sdk. I compiled correctly the release and copied it in the binary directory.

But when lauching the app, it breaks and here is the location where it points (perhaps that can help you to pinpoint the problem)

in dbghook.c:
void __cdecl _CRT_DEBUGGER_HOOK(int _Reserved)
{
/* assign 0 to _debugger_hook_dummy so that the function is not folded in retail */
(_Reserved);
-> _debugger_hook_dummy = 0;
}
The little arrow shows the debugger break.

I would really like this program to work, since it is a great one. (It is my first time working with ogre files)
JonasBS
Gnoblar
Posts: 21
Joined: Wed Apr 27, 2005 1:43 pm

Post by JonasBS »

jacmoe wrote:Totally killer! :D

Even if I only get about FPS 0.8, it looks great! :wink:
And he even gets 76 fps- so the performance shouldn't be too bad!! Wow really well done!!! But this thing with teh 0.8 fps could be my computer: Intel Celeron 2.4 Ghz and Graphics onboard :cry: :D :D :D :wink:
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Post by jacmoe »

Shouldn't this be in the Ogre demos?
Any reason why it isn't? Because it's a very cool demo. :)
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
User avatar
DWORD
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 1365
Joined: Tue Sep 07, 2004 12:43 pm
Location: Aalborg, Denmark
Contact:

Post by DWORD »

Well, there was some talk about it IIRC, but the license wasn't lenient enough. But I changed it to public domain back then, so that should be no problem. I don't know if it runs out of the box with the newest versions of Ogre, though. But I think it'd be great if it did make it into an Ogre demo of course. :)

Latest sources are here: http://dword.dk/blog/software/ogre/dof/

Unfortunately I haven't had much time to spend with Ogre lately, but I'm still around...
User avatar
Red5_StandingBy
Greenskin
Posts: 109
Joined: Mon Jun 26, 2006 1:06 pm
Location: Turkey

Post by Red5_StandingBy »

Hi,

This is a great demo. I have been playing around with it and it really looks cool with shadows and HDR.

Just one issue I came across: The depth render texture pass does not seem to disable shadows. There is a call for that in DepthOfFieldEffect::createDepthRenderTexture() fnuction:

invocation->setSuppressShadows(true);

But somehow we get all the shadow passes anyway. So I had to add a line:
depthViewport->setShadowsEnabled( false );

in the same function to disable shadows.

Still very nice work indeed 8)
User avatar
ENGine
Goblin
Posts: 266
Joined: Fri Jan 27, 2006 9:13 pm
Location: Belarus
x 2
Contact:

Post by ENGine »

I have error
---------------------------
Microsoft Visual C++ Runtime Library
---------------------------
Assertion failed!

Program: ...
File: e:\disk_e\dev\ogre\ogrenew_vs200...\ogregp...ram.cpp
Line: 621

Expression: physicalIndex + count <= mFloatConstants.size()

For information on how your program can cause an assertion
failure, see the Visual C++ documentation on asserts

(Press Retry to debug the application - JIT must be enabled)
---------------------------
Прервать Повтор ПропуÑ
User avatar
RedEyeCoder
Gnome
Posts: 344
Joined: Sat Jun 16, 2007 7:29 am
Location: Brisbane, Australia

Post by RedEyeCoder »

Really great work DWORD / eyevee99!
mhebel
Gnoblar
Posts: 1
Joined: Mon Feb 11, 2008 11:50 pm

Trying to get this working in Compositor Demo

Post by mhebel »

Hi,
I'm trying to apply a compositor script with this incredible dof in the CompositorDemoApplication (not interactive, just with fixed values) coming with the OgreSDK. But actually it's not working right.

So for you to understand, I adjusted the code from the cpp-files into simple ogre-material and hlsl fragments:

To add the compositor to the application, I added those lines to Examples.compositor:

Code: Select all

// Depth of Field from Christian Lindequist Larsen // modified
compositor Puffi_DOF
{
    technique
    {
        texture scene target_width target_height PF_A8R8G8B8
        texture depth target_width target_height PF_A8R8G8B8
        texture blur target_width target_height PF_A8R8G8B8
        

        target scene
        {
            input previous
        }
        
        target depth
        {
        		pass render_quad
        		{
        			material Ogre/Compositor/DoF_Depth
             	input 0 scene 
        		}
        }
        
        target blur
        {
        		pass render_quad 
        		{  
	        		material Ogre/Compositor/DoF_Gaussian3x3
             	input 0 scene 
        		}
        }
        

        target_output
        {   
            pass render_quad 
           {
                material Ogre/Compositor/DoF_DepthOfField
                input 0 scene
                input 1 depth
                input 2 blur         
            }
        }

    }
}
As I got an error with different materials in one file, I put each of it in a single .material file:

DoF_Depth.material:

Code: Select all

material Ogre/Compositor/DoF_Depth
{
technique 
  {
    pass
    {
      vertex_program_ref DoF_DepthVP_HLSL
      {
      }

      fragment_program_ref DoF_DepthFP_HLSL
      {
      }
    }
  }
}

DoF_Gaussian3x3.material:

Code: Select all

material Ogre/Compositor/DoF_Gaussian3x3
{
  technique
  {
    pass
    {
      fragment_program_ref DoF_Gaussian3x3FP_HLSL
      {
      }

      texture_unit source
      {
        tex_address_mode clamp
      }
    }
  }
}

DoF_DepthOfField.material:

Code: Select all

material Ogre/Compositor/DoF_DepthOfField
{
 technique
  {
    pass
    {
      fragment_program_ref DoF_DepthOfFieldFP_HLSL
      {
      }

      texture_unit scene
      {
        tex_address_mode clamp
      }

      texture_unit depth
      {
       tex_address_mode clamp
       texture DoF_Depth
      }

      texture_unit blur
      {
        tex_address_mode clamp
      }
    }
  }
}
I won't put the source calls for hlsl here as I copied the DoF.program-file.

At last I modified the .hlsl-files to my needs (only showing the adjusted files, everything else is just put into the right place (file structure):

DoF_Depth_HLSL.frag:

Code: Select all

uniform float4 dofParams;
sampler2D g_samSrcColor;

struct VS_OUTPUT
{
  float4 viewPos : POSITION;
  float depth    : TEXCOORD0;
};

float4 main(VS_OUTPUT input) : COLOR0
{

  float f;
  // just adjust the paramters here manually
  //dofParams = float4(0.1f, 0.5f, 0.9f, 0.1f);
  dofParams = float4(10.0f, 100.0f, 190.0f, 1.0f);
  
  
  if (input.depth < dofParams.y)
  {
    // scale depth value between near blur distance and focal distance to
    // [-1, 0] range
    f = (input.depth - dofParams.y) / (dofParams.y - dofParams.x);
  }
  else
  {
    // scale depth value between focal distance and far blur distance to
    // [0, 1] range
    f = (input.depth - dofParams.y) / (dofParams.z - dofParams.y);
    // clamp the far blur to a maximum blurriness
    f = clamp(f, 0.0, dofParams.w);
  }

  // scale and bias into [0, 1] range
  f = 0.5f*f + 0.5f;
  return float4(f,f,f,1.0);
}

DoF_Gaussian3x3_HLSL.frag:
just added a line with setting the pixelSize manually.

DoF_DepthOfField_HLSL.frag:
the same, just set the pixelSizeScene and pixelSizeBlur manually.


In the demo, the first part of the material (target scene) works. The third part (target blur) also. But the second one (target depth) shows only a black texture. So there has to be an error here. As I haven't modified the vertex shader, the output must be ok, and in the pixel shader I just modified "dofParams". I don't get it as the math seems to be ok. Can someone help me to find the problem?

(Can it be that I have to add the lens to my scene as DWORD did in MyApplication.cpp:

Code: Select all

// Create a lens to control depth of field
mLens = new Lens(mCamera->getFOVy(), 1.5);
mLens->setFocalDistance(171.5);
User avatar
jingjie
Kobold
Posts: 35
Joined: Mon Jul 18, 2005 5:00 am

Post by jingjie »

[quote="ENGine"]I have error
---------------------------
Microsoft Visual C++ Runtime Library
---------------------------
Assertion failed!

Program: ...
File: e:\disk_e\dev\ogre\ogrenew_vs200...\ogregp...ram.cpp
Line: 621

Expression: physicalIndex + count <= mFloatConstants.size()

For information on how your program can cause an assertion
failure, see the Visual C++ documentation on asserts

(Press Retry to debug the application - JIT must be enabled)
---------------------------
Прервать Повтор ПропуÑ
KarelCharel
Gnoblar
Posts: 1
Joined: Fri Apr 11, 2008 12:44 pm

Post by KarelCharel »

jingjie,

I had the same problem with Eihort, and solved it using the setNamedConstant(const String & name, const Vector4 & vec) variant for setting the fragmentProgramParameters.

Use a float4 instead of a float2 for the pixelSize in de blur shader (just discard the 3rd and 4th element).

In the DoF_DepthOfField shader, I used one float4 for the blur and scene pixel size instead of two float2's.

Seems like the setNamedConstant(const String & name, const float * val, size_t count, size_t multiple = 4) doesn't work the same way in Eihort as in Dragon?
User avatar
jingjie
Kobold
Posts: 35
Joined: Mon Jul 18, 2005 5:00 am

Post by jingjie »

KarelCharel wrote: Seems like the setNamedConstant(const String & name, const float * val, size_t count, size_t multiple = 4) doesn't work the same way in Eihort as in Dragon?
I solves the problem by setting multiple = 1 about calling function setNamedConstant(const String & name, const float * val, size_t count, size_t multiple = 4). :lol:
User avatar
eugen
OGRE Expert User
OGRE Expert User
Posts: 1422
Joined: Sat May 22, 2004 5:28 am
Location: Bucharest
x 8
Contact:

Post by eugen »

i believe u should set count to 1 and leave mutiple to 4 :) but is the same in this context
macintosh_seu
Kobold
Posts: 31
Joined: Sat Apr 26, 2008 9:35 am

Post by macintosh_seu »

I got the same error as ENGine
---------------------------
Microsoft Visual C++ Runtime Library
---------------------------
Assertion failed!

Program: ...
File: e:\disk_e\dev\ogre\ogrenew_vs200...\ogregp...ram.cpp
Line: 621

Expression: physicalIndex + count <= mFloatConstants.size()

For information on how your program can cause an assertion
failure, see the Visual C++ documentation on asserts

(Press Retry to debug the application - JIT must be enabled)
---------------------------

I run the demo bunary well, but when I rebuild the project, and modify some line for inputdevice, such as change "inputdevice" to "mKeyboard", then I got crash.

I read the log, the program seems stop at "OIS initilize"

And, my card is X800GTO, I have change the line to PS_2_b in the .program file

Anyone can help me?
I really love this demo, but I dont know to solve the problem~
lukeneorm
Halfling
Posts: 61
Joined: Wed Apr 01, 2009 12:03 am

Re: Depth of Field demo release

Post by lukeneorm »

Hi, does anyone got this working on recent OGRE releases? I have a couple of problems..
To use DOF in my project (using OGRE 1.6.3), I do the following:
I added this files to the project: depthOfFieldEffect.h, Lens.h, Prerequisites.h, depthOfFieldEffect.cpp, Lens.cpp
I added this initialization code:

Code: Select all

	DepthOfFieldEffect* mDepthOfFieldEffect;
	Lens* mLens;
	mDepthOfFieldEffect = new DepthOfFieldEffect(myVp);
	mDepthOfFieldEffect->setEnabled(true);
I added this to the framestarted() function of my frameListener:

Code: Select all

	float nearDepth, focalDepth, farDepth;
	mLens->recalculateDepthOfField(nearDepth, focalDepth, farDepth);
	mDepthOfFieldEffect->setFocalDepths(nearDepth, focalDepth, farDepth);
For compatibility with recent releases, I modify these lines in createCompositor() function in DepthOfFieldEffect.cpp:

Code: Select all

	//Instead of this..
	//definition->format = PF_X8R8G8B8;

	//..I use this:
	Ogre::PixelFormatList l;
	l.push_back(Ogre::PF_X8R8G8B8);
	definition->formatList = l;

and these lines in DepthOfFieldEffect::notifyMaterialSetup():

Code: Select all

			//fragParams->setNamedConstant("pixelSize", pixelSize, sizeof(pixelSize)/sizeof(pixelSize[0]));
			fragParams->setNamedConstant("pixelSize", pixelSize, 1, 2);
			//fragParams->setNamedConstant("pixelSizeScene", pixelSizeScene,sizeof(pixelSizeScene)/sizeof(pixelSizeScene[0]));
			fragParams->setNamedConstant("pixelSizeScene", pixelSizeScene,1, 2);
			//fragParams->setNamedConstant("pixelSizeBlur", pixelSizeBlur,sizeof(pixelSizeBlur)/sizeof(pixelSizeBlur[0]));
			fragParams->setNamedConstant("pixelSizeBlur", pixelSizeBlur,1, 2);

Well, at this point wen I run the application I got an exception: "Access violation reading" when calling this line of code:

Code: Select all

	mDepthOfFieldEffect->setEnabled(true);

..I think I did the right passes to use DOF in my project.
I use OGRE 1.6.3, my video card is NVIDIA GeForce9600M GT, and I use OGL.
If I use D3D, ogre.log says that

Code: Select all

	18:51:05: WARNING: material DoF_DepthOfField has no supportable Techniques and will be blank. Explanation: 
	Pass 0: Fragment program DoF_DepthOfFieldFP_GLSL cannot be used - not supported.
	Pass 0: Fragment program DoF_DepthOfFieldFP_HLSL cannot be used - compile error.
	18:51:05: WARNING: material DoF_DepthOfField has no supportable Techniques and will be blank. Explanation: 
	Pass 0: Fragment program DoF_DepthOfFieldFP_GLSL cannot be used - not supported.
	Pass 0: Fragment program DoF_DepthOfFieldFP_HLSL cannot be used - compile error.
even if I use ps_2_b flag in Dof.program for fragment_program DoF_DepthOfFieldFP_HLSL.

It is a very beautiful effect, and I'd like to use it in my project.. but I can't understand what kind of error it is.
Anyone got this working on recent OGRE releases? :?

Thank you!
db123
Halfling
Posts: 78
Joined: Wed May 21, 2008 5:55 am

Re: Depth of Field demo release

Post by db123 »

it looks very nice, thanks for your good work. :D
Robloch
Gnoblar
Posts: 5
Joined: Tue Oct 20, 2009 10:14 am

Re: Depth of Field demo release

Post by Robloch »

Hello everyone

I had same problem than lukeneorm when I launch my program with direct3D render system :/ It seems that cg script aren't compatible with directx.

With OpenGL, scripts compile without any problem but then i have an assertion error in ogregpuprogram.h line 835. I'm new to cg programming and i don't understand why :'(

If anyone can help, it would be great :)

EDIT : btw, I'm using seven, my graphic card is a RADEON 4870 and the latest demo by dword is working with Opengl renderer system.
User avatar
Olganix
Halfling
Posts: 41
Joined: Thu Nov 06, 2008 4:18 pm

Re: Depth of Field demo release

Post by Olganix »

Hi, I have tested yours code. it's nice effect.

@Robloch: I use the 0.1.4 source of dof but I don't see cg script but GLSL and HLSL.

I give you cg script which I made from the HLSL file (for me the HLSL file of Dof doesn't work ( I'm in directX9, nvidia Geforce 8800 GT with the driver of NVPerfHUD ) ):

error on HLSL:

Code: Select all


10:38:09: OGRE EXCEPTION(3:RenderingAPIException): Cannot assemble D3D9 high-level shader DoF_Gaussian3x3FP_HLSL Errors:
c:\Developpement\Dev\Ogre\ogre-v1-6-SVN-maintenance_090827\ogre\Samples\Common\bin\Debug\memory(17,14): error X3025: global variables are implicitly constant, enable compatibility mode to allow modification
 in D3D9HLSLProgram::loadFromSource at c:\developpement\dev\ogre\ogre-v1-6-svn-maintenance_090827\ogre\rendersystems\direct3d9\src\ogred3d9hlslprogram.cpp (line 199)
10:38:09: High-level program DoF_Gaussian3x3FP_HLSL encountered an error during loading and is thus not supported.
OGRE EXCEPTION(3:RenderingAPIException): Cannot assemble D3D9 high-level shader DoF_Gaussian3x3FP_HLSL Errors:
c:\Developpement\Dev\Ogre\ogre-v1-6-SVN-maintenance_090827\ogre\Samples\Common\bin\Debug\memory(17,14): error X3025: global variables are implicitly constant, enable compatibility mode to allow modification
 in D3D9HLSLProgram::loadFromSource at c:\developpement\dev\ogre\ogre-v1-6-svn-maintenance_090827\ogre\rendersystems\direct3d9\src\ogred3d9hlslprogram.cpp (line 199)
10:38:09: OGRE EXCEPTION(3:RenderingAPIException): Cannot assemble D3D9 high-level shader DoF_DepthOfFieldFP_HLSL Errors:
c:\Developpement\Dev\Ogre\ogre-v1-6-SVN-maintenance_090827\ogre\Samples\Common\bin\Debug\memory(24,15): error X3025: global variables are implicitly constant, enable compatibility mode to allow modification
 in D3D9HLSLProgram::loadFromSource at c:\developpement\dev\ogre\ogre-v1-6-svn-maintenance_090827\ogre\rendersystems\direct3d9\src\ogred3d9hlslprogram.cpp (line 199)
10:38:09: High-level program DoF_DepthOfFieldFP_HLSL encountered an error during loading and is thus not supported.
OGRE EXCEPTION(3:RenderingAPIException): Cannot assemble D3D9 high-level shader DoF_DepthOfFieldFP_HLSL Errors:
c:\Developpement\Dev\Ogre\ogre-v1-6-SVN-maintenance_090827\ogre\Samples\Common\bin\Debug\memory(24,15): error X3025: global variables are implicitly constant, enable compatibility mode to allow modification
 in D3D9HLSLProgram::loadFromSource at c:\developpement\dev\ogre\ogre-v1-6-svn-maintenance_090827\ogre\rendersystems\direct3d9\src\ogred3d9hlslprogram.cpp (line 199)

try this, unless I didn't take the lastest source:

Dof.cg:

Code: Select all


void DoF_DepthVP_cg(  float4 worldPos		: POSITION,
                      out float4 viewPos	: POSITION,
                      out float4 viewPos2 : TEXCOORD0,
                  		out float depth     : TEXCOORD1,
                  		uniform float4x4 worldViewProj
                      )        
{
	viewPos = mul(worldViewProj, worldPos);
	viewPos2 = viewPos;
	depth = viewPos.z;
}




void DoF_DepthFP_cg(  float4 viewPos  : TEXCOORD0,
                      float depth     : TEXCOORD1,
                      out float4 color : COLOR,
                      uniform float4  dofParams                                 // dofParams coefficients: x = near blur depth; y = focal plane depth; z = far blur depth,  w = blurriness cutoff constant for objects behind the focal plane
                      )
{
  
  
  float f;
  
  if(depth<dofParams.y)
  {    
    f = (depth - dofParams.y) / (dofParams.y - dofParams.x);                    // scale depth value between near blur distance and focal distance to [-1, 0] range
  }else{
    f = (depth - dofParams.y) / (dofParams.z - dofParams.y);                    // scale depth value between focal distance and far blur distance to [0, 1] range    
    f = clamp(f, 0.0, dofParams.w);                                             // clamp the far blur to a maximum blurriness
  }
  
  f = 0.5f*f + 0.5f;                                                            // scale and bias into [0, 1] range
  
  color = float4(f,f,f,1);
}


/*******************************************************************************/


void DoF_Gaussian3x3VP_cg(  float4 worldPos		: POSITION,
                            float2 textCoordi : TEXCOORD0,
                            out float4 viewPos	: POSITION,
                            out float2 textCoordo : TEXCOORD0,
                        		uniform float4x4 worldViewProj
                            )        
{
	viewPos = mul(worldViewProj, worldPos);
	textCoordo = textCoordi;
}

void DoF_Gaussian3x3FP_cg(  float2 tex  : TEXCOORD0,
                            out float4 color : COLOR,
                            uniform sampler2D source : register(s0),
                            uniform float3 pixelSize
                            )
{
  
  #define KERNEL_SIZE 9
  
  float weights[KERNEL_SIZE];
  float2 offsets[KERNEL_SIZE];
  
  weights[0] = 1.0/16.0; weights[1] = 2.0/16.0; weights[2] = 1.0/16.0;
  weights[3] = 2.0/16.0; weights[4] = 4.0/16.0; weights[5] = 2.0/16.0;
  weights[6] = 1.0/16.0; weights[7] = 2.0/16.0; weights[8] = 1.0/16.0;

  offsets[0] = float2(-pixelSize.x, -pixelSize.y);
  offsets[1] = float2(0, -pixelSize.y);
  offsets[2] = float2(pixelSize.x, -pixelSize.y);
  offsets[3] = float2(-pixelSize.x, 0);
  offsets[4] = float2(0, 0);
  offsets[5] = float2(pixelSize.x, 0);
  offsets[6] = float2(-pixelSize.x, pixelSize.y);
  offsets[7] = float2(0,  pixelSize.y);
  offsets[8] = float2(pixelSize.x, pixelSize.y);

  color = float4(0,0,0,0);

  for (int i = 0; i < KERNEL_SIZE; ++i)
    color += weights[i] * tex2D(source, tex + offsets[i]);
}




/*******************************************************************************/
  

void DoF_DepthOfFieldVP_cg(  float4 worldPos		: POSITION,
                            float2 textCoordi : TEXCOORD0,
                            out float4 viewPos	: POSITION,
                            out float2 textCoordo : TEXCOORD0,
                        		uniform float4x4 worldViewProj
                            )        
{
	viewPos = mul(worldViewProj, worldPos);
	textCoordo = textCoordi;
}

void DoF_DepthOfFieldFP_cg( float2 tex  : TEXCOORD0,
                            out float4 color : COLOR,
                            uniform sampler2D scene : register(s0),             // full resolution image
                            uniform sampler2D depth : register(s1),             // full resolution image with depth values
                            uniform sampler2D blur  : register(s2),             // downsampled and blurred image
                            uniform float3 pixelSizeScene,                      // pixel size of full resolution image
                            uniform float3 pixelSizeBlur                       // pixel size of downsampled and blurred image
                            )
{
  
  #define NUM_TAPS 12                     // number of taps the shader will use
  
  float2 poisson[NUM_TAPS];               // containts poisson-distributed positions on the unit circle
  float2 maxCoC;                          // maximum circle of confusion (CoC) radius and diameter in pixels
  float radiusScale;                      // scale factor for minimum CoC size on low res. image
  
  poisson[ 0] = float2( 0.00,  0.00);
  poisson[ 1] = float2( 0.07, -0.45);
  poisson[ 2] = float2(-0.15, -0.33);
  poisson[ 3] = float2( 0.35, -0.32);
  poisson[ 4] = float2(-0.39, -0.26);
  poisson[ 5] = float2( 0.10, -0.23);
  poisson[ 6] = float2( 0.36, -0.12);
  poisson[ 7] = float2(-0.31, -0.01);
  poisson[ 8] = float2(-0.38,  0.22);
  poisson[ 9] = float2( 0.36,  0.23);
  poisson[10] = float2(-0.13,  0.29);
  poisson[11] = float2( 0.14,  0.41);
  
  maxCoC = float2(5.0, 10.0);
  radiusScale = 0.4;

  // Get depth of center tap and convert it into blur radius in pixels
  float centerDepth = tex2D(depth, tex).r;
  float discRadiusScene = abs(centerDepth * maxCoC.y - maxCoC.x);
  float discRadiusBlur = discRadiusScene * radiusScale; // radius on low res. image

  float4 sum = float4(0.0,0.0,0.0,0.0);

  for (int i = 0; i < NUM_TAPS; ++i)
  {
    // compute texture coordinates
    float2 coordScene = tex + (pixelSizeScene.xy * poisson[i] * discRadiusScene);
    float2 coordBlur = tex + (pixelSizeBlur.xy * poisson[i] * discRadiusBlur);
  
    // fetch taps and depth
    float4 tapScene = tex2D(scene, coordScene);
    float tapDepth = tex2D(depth, coordScene).r;
    float4 tapBlur = tex2D(blur, coordBlur);
    
    // mix low and high res. taps based on tap blurriness
    float blurAmount = abs(tapDepth * 2.0 - 1.0); // put blurriness into [0, 1]
    float4 tap = lerp(tapScene, tapBlur, blurAmount);
  
    // "smart" blur ignores taps that are closer than the center tap and in focus
    float factor = (tapDepth >= centerDepth) ? 1.0 : abs(tapDepth * 2.0 - 1.0);
  
    // accumulate
    sum.rgb += tap.rgb * factor;
    sum.a += factor;
  }
  
  color = (sum / sum.a);
}

I modified the Dof.material ( sorry for declarations of shader in Dof.material instead of Dof.program ):

Code: Select all


// "Depth of Field" demo for Ogre
// Copyright (C) 2006  Christian Lindequist Larsen
//
// This code is in the public domain. You may do whatever you want with it.



vertex_program DoF_DepthVP_cg cg			
{
    source DoF.cg
    entry_point DoF_DepthVP_cg
    profiles vs_3_0					
    
    default_params					
    {
        param_named_auto worldViewProj worldviewproj_matrix		
    }
}


fragment_program DoF_DepthFP_cg cg
{
	source DoF.cg
	entry_point DoF_DepthFP_cg
	profiles ps_3_0
}

/////////////////////////////////////////////////////////////////////

vertex_program DoF_Gaussian3x3VP_cg cg			
{
    source DoF.cg
    entry_point DoF_Gaussian3x3VP_cg
    profiles vs_3_0					
    
    default_params					
    {
        param_named_auto worldViewProj worldviewproj_matrix		
    }
}

fragment_program DoF_Gaussian3x3FP_cg cg
{
	source DoF.cg
	entry_point DoF_Gaussian3x3FP_cg
	profiles ps_3_0
}

/////////////////////////////////////////////////////////////////////


vertex_program DoF_DepthOfFieldVP_cg cg			
{
    source DoF.cg
    entry_point DoF_DepthOfFieldVP_cg
    profiles vs_3_0					
    
    default_params					
    {
        param_named_auto worldViewProj worldviewproj_matrix		
    }
}

fragment_program DoF_DepthOfFieldFP_cg cg
{
	source DoF.cg
	entry_point DoF_DepthOfFieldFP_cg
	profiles ps_3_0
}



/*********************************************************************************/


material DoF_Depth
{
  technique cg
  {
    pass
    {
      vertex_program_ref DoF_DepthVP_cg
      {
      }

      fragment_program_ref DoF_DepthFP_cg
      {
        //trouver de bonnes valeurs // dofParams coefficients: x = near blur depth; y = focal plane depth; z = far blur depth,  w = blurriness cutoff constant for objects behind the focal plane
        param_named dofParams float4 0.3 0.3 0.3 0.3
      }
    }
  }
  
  technique GLSL
  {
    pass
    {
      vertex_program_ref DoF_DepthVP_GLSL
      {
      }

      fragment_program_ref DoF_DepthFP_GLSL
      {
      }
    }
  }

  technique HLSL
  {
    pass
    {
      vertex_program_ref DoF_DepthVP_HLSL
      {
      }

      fragment_program_ref DoF_DepthFP_HLSL
      {
      }
    }
  }
}


/////////////////////////////////////////////////////////////////////


material DoF_Gaussian3x3
{
  technique cg
  {
    pass
    { 
      vertex_program_ref DoF_Gaussian3x3VP_cg
      {
      }
      
      fragment_program_ref DoF_Gaussian3x3FP_cg
      {
        param_named pixelSize float3 0.03 0.03 0.03
      }

      texture_unit source
      {
        tex_address_mode clamp
      }
    }
  }
  
  
  technique GLSL
  {
    pass
    {
      fragment_program_ref DoF_Gaussian3x3FP_GLSL
      {
      }

      texture_unit source
      {
        tex_address_mode clamp
      }
    }
  }

  technique HLSL
  {
    pass
    {
      fragment_program_ref DoF_Gaussian3x3FP_HLSL
      {
      }

      texture_unit source
      {
        tex_address_mode clamp
      }
    }
  }
}



/////////////////////////////////////////////////////////////////////



material DoF_DepthOfField
{
  technique cg
  {
    pass
    {
      vertex_program_ref DoF_DepthOfFieldVP_cg
      {
      }
      
      fragment_program_ref DoF_DepthOfFieldFP_cg
      {
        param_named pixelSizeScene float3 0.03 0.03 0.03
        param_named pixelSizeBlur float3 0.03 0.03 0.03
      }

      texture_unit scene
      {
        tex_address_mode clamp
      }

      texture_unit depth
      {
        tex_address_mode clamp
        texture DoF_Depth
      }

      texture_unit blur
      {
        tex_address_mode clamp
      }
    }
  }
  
  
  
  technique GLSL
  {
    pass
    {
      fragment_program_ref DoF_DepthOfFieldFP_GLSL
      {
      }

      texture_unit scene
      {
        tex_address_mode clamp
      }

      texture_unit depth
      {
        tex_address_mode clamp
        texture DoF_Depth
      }

      texture_unit blur
      {
        tex_address_mode clamp
      }
    }
  }

  technique HLSL
  {
    pass
    {
      fragment_program_ref DoF_DepthOfFieldFP_HLSL
      {
      }

      texture_unit scene
      {
        tex_address_mode clamp
      }

      texture_unit depth
      {
        tex_address_mode clamp
        texture DoF_Depth
      }

      texture_unit blur
      {
        tex_address_mode clamp
      }
    }
  }
}

material DoF_FocusArea
{
  technique
  {
    pass
    {
      scene_blend alpha_blend
      
      texture_unit
      {
        texture focus.png
        alpha_op_ex modulate src_texture src_manual 0.2
      }
    }
  }
}

material DoF_DepthDebug
{
  technique
  {
    pass
    {
      texture_unit
      {
        // This texture needs to be assigned at run-time because
        // the debug overlay loads the material, and this would
        // create a stand-in texture before the render texture is
        // created leading to a crash.
        //texture DoF_Depth
      }
    }
  }
}


I also write a Dof.compositor:

Code: Select all


// Anti Flicking blur effect
compositor "DoF_Compositor_test"
{
  technique
  {
      // Temporary textures
      texture scene 0 0 PF_X8R8G8B8
      texture blur target_width_scaled 0.5 target_height_scaled 0.5 PF_X8R8G8B8
      
      target scene
      {
        // Render output from previous compositor (or original scene)
        input previous
      }
      
      target blur
      {
        input none
        pass render_quad
        {
          material DoF_Gaussian3x3
          input 0 scene
          identifier 0
        }
      }
      
      
      target_output
      {
        // Blur horizontally
        //input none
        pass render_quad
        {
          material DoF_DepthOfField
          input 0 scene
          input 2 blur
          identifier 1
        }
      }
      
  }
}

I rename to "DoF_Compositor_test" to not make problems with DoF_Compositor in code.
So I'm use:

Code: Select all


//mCompositor = CompositorManager::getSingleton().addCompositor(mViewport, "DoF_Compositor");		// Add the compositor to the viewport
mCompositor = CompositorManager::getSingleton().addCompositor(mViewport, "DoF_Compositor_test");		// Add the compositor to the viewport

(note: I make some changes which you have speaked above:

Code: Select all


//definition->format = PF_X8R8G8B8;
definition->formatList.push_back(PF_X8R8G8B8);

and
Ogre::Vector3 pixelSize = Ogre::Vector3(1.0f / (mViewport->getActualWidth() / BLUR_DIVISOR),1.0f / (mViewport->getActualHeight() / BLUR_DIVISOR));
if((!fragParams.isNull())&&(fragParams->_findNamedConstantDefinition("pixelSize")))
	fragParams->setNamedConstant("pixelSize", pixelSize );

//setNamedConstant() dont use Vector2, that why I use vector3 ( same in my shader )
//so, if you want keep pixelSize[2], change in Dof.material param_named pixelSize float3 0.03 0.03 0.03 => param_named pixelSize float2 0.03 0.03
//and in Dof.cg uniform float3 pixelSize => uniform float2 pixelSize

//note: same with pixelSizeScene and pixelSizeBlur

)

I hope it will help you.

If someone see something wrong in this code, please notify. Sorry for my english.
Robloch
Gnoblar
Posts: 5
Joined: Tue Oct 20, 2009 10:14 am

Re: Depth of Field demo release

Post by Robloch »

Thanks for the help, i'm not at home right now but i will test it soon. I really am a noob in cg, hlsl or glsl script. I dont really know what are the differences.

See ya
lukeneorm
Halfling
Posts: 61
Joined: Wed Apr 01, 2009 12:03 am

Re: Depth of Field demo release

Post by lukeneorm »

Olganix wrote:If someone see something wrong in this code, please notify. Sorry for my english.
I try your code: now everything seems to work fine! THANK YOU MAN! :D

NB: when you create the Vector3 for pixelSize and other variables, you missed the last parameter for create a 3-item vector:

Code: Select all

//Ogre::Vector3 pixelSize = Ogre::Vector3(1.0f / (mViewport->getActualWidth() / BLUR_DIVISOR),  1.0f / (mViewport->getActualHeight() / BLUR_DIVISOR));
//Add a '1.0' as 3rd parameter
Ogre::Vector3 pixelSize = Ogre::Vector3(1.0f / (mViewport->getActualWidth() / BLUR_DIVISOR),  1.0f / (mViewport->getActualHeight() / BLUR_DIVISOR),  1.0);
Thank you again! ;)
User avatar
tdev
Silver Sponsor
Silver Sponsor
Posts: 244
Joined: Thu Apr 12, 2007 9:21 pm
Location: Germany
x 14

Re: Depth of Field demo release

Post by tdev »

got olganix's CG version working (thank you!), as reference you can also use my diff:
source: http://rigsofrods.svn.sourceforge.net/v ... vision=759
and:
contents (removed all glsl/hlsl things):
source: http://rigsofrods.svn.sourceforge.net/v ... vision=761

edit: i wrapped the demo into a component that includes the creation/destruction and focusing (see DOFManager):
http://rigsofrods.svn.sourceforge.net/v ... iew=markup
http://rigsofrods.svn.sourceforge.net/v ... iew=markup
User avatar
Florin
Kobold
Posts: 33
Joined: Thu Mar 19, 2009 3:15 am

Re: Depth of Field demo release

Post by Florin »

The last two links are broken. Would you please post the demo on a valid link ?
Robloch
Gnoblar
Posts: 5
Joined: Tue Oct 20, 2009 10:14 am

Re: Depth of Field demo release

Post by Robloch »

Hello,

these are my files. I have modified them in order to set up 2 compositors .... I'm a bit noob in CG prog and compositors in OGRE.

Maybe it'll help you (It can work without setting 2 compositors)
Attachments
DOF.zip
(7.99 KiB) Downloaded 345 times
User avatar
Florin
Kobold
Posts: 33
Joined: Thu Mar 19, 2009 3:15 am

Re: Depth of Field demo release

Post by Florin »

I tried to solve the problem macintosh_seu and others reported
Expression: physicalIndex + count <= mFloatConstants.size()

For information on how your program can cause an assertion
failure, see the Visual C++ documentation on asserts
I tried to follow some of the clues from this forum but I get stuck on this error.

I posted the Ogre log, maybe it helps.

Code: Select all

03:18:27: Creating resource group General
03:18:27: Creating resource group Internal
03:18:27: Creating resource group Autodetect
03:18:27: SceneManagerFactory for type 'DefaultSceneManager' registered.
03:18:27: Registering ResourceManager for type Material
03:18:27: Registering ResourceManager for type Mesh
03:18:27: Registering ResourceManager for type Skeleton
03:18:27: MovableObjectFactory for type 'ParticleSystem' registered.
03:18:27: OverlayElementFactory for type Panel registered.
03:18:27: OverlayElementFactory for type BorderPanel registered.
03:18:27: OverlayElementFactory for type TextArea registered.
03:18:27: Registering ResourceManager for type Font
03:18:27: ArchiveFactory for archive type FileSystem registered.
03:18:27: ArchiveFactory for archive type Zip registered.
03:18:27: FreeImage version: 3.10.0
03:18:27: This program uses FreeImage, a free, open source image library supporting all common bitmap formats. See http://freeimage.sourceforge.net for details
03:18:27: Supported formats: bmp,ico,jpg,jif,jpeg,jpe,jng,koa,iff,lbm,mng,pbm,pbm,pcd,pcx,pgm,pgm,png,ppm,ppm,ras,tga,targa,tif,tiff,wap,wbmp,wbm,psd,cut,xbm,xpm,gif,hdr,g3,sgi,exr,j2k,j2c,jp2
03:18:27: DDS codec registering
03:18:27: Registering ResourceManager for type HighLevelGpuProgram
03:18:27: Registering ResourceManager for type Compositor
03:18:27: MovableObjectFactory for type 'Entity' registered.
03:18:27: MovableObjectFactory for type 'Light' registered.
03:18:27: MovableObjectFactory for type 'BillboardSet' registered.
03:18:27: MovableObjectFactory for type 'ManualObject' registered.
03:18:27: MovableObjectFactory for type 'BillboardChain' registered.
03:18:27: MovableObjectFactory for type 'RibbonTrail' registered.
03:18:27: Loading library .\RenderSystem_Direct3D9_d
03:18:27: Installing plugin: D3D9 RenderSystem
03:18:27: D3D9 : Direct3D9 Rendering Subsystem created.
03:18:27: D3D9: Driver Detection Starts
03:18:27: D3D9: Driver Detection Ends
03:18:27: Plugin successfully installed
03:18:27: Loading library .\RenderSystem_GL_d
03:18:27: Installing plugin: GL RenderSystem
03:18:27: OpenGL Rendering Subsystem created.
03:18:27: Plugin successfully installed
03:18:27: Loading library .\Plugin_ParticleFX_d
03:18:27: Installing plugin: ParticleFX
03:18:27: Particle Emitter Type 'Point' registered
03:18:27: Particle Emitter Type 'Box' registered
03:18:27: Particle Emitter Type 'Ellipsoid' registered
03:18:27: Particle Emitter Type 'Cylinder' registered
03:18:27: Particle Emitter Type 'Ring' registered
03:18:27: Particle Emitter Type 'HollowEllipsoid' registered
03:18:27: Particle Affector Type 'LinearForce' registered
03:18:27: Particle Affector Type 'ColourFader' registered
03:18:27: Particle Affector Type 'ColourFader2' registered
03:18:27: Particle Affector Type 'ColourImage' registered
03:18:27: Particle Affector Type 'ColourInterpolator' registered
03:18:27: Particle Affector Type 'Scaler' registered
03:18:27: Particle Affector Type 'Rotator' registered
03:18:27: Particle Affector Type 'DirectionRandomiser' registered
03:18:27: Particle Affector Type 'DeflectorPlane' registered
03:18:27: Plugin successfully installed
03:18:27: Loading library .\Plugin_BSPSceneManager_d
03:18:27: Installing plugin: BSP Scene Manager
03:18:27: Plugin successfully installed
03:18:27: Loading library .\Plugin_CgProgramManager_d
03:18:27: Installing plugin: Cg Program Manager
03:18:28: Plugin successfully installed
03:18:28: Loading library .\Plugin_PCZSceneManager_d.dll
03:18:28: Installing plugin: Portal Connected Zone Scene Manager
03:18:28: PCZone Factory Type 'ZoneType_Default' registered
03:18:28: Plugin successfully installed
03:18:28: Loading library .\Plugin_OctreeZone_d.dll
03:18:28: Installing plugin: Octree Zone Factory
03:18:28: Plugin successfully installed
03:18:28: Loading library .\Plugin_OctreeSceneManager_d
03:18:28: Installing plugin: Octree & Terrain Scene Manager
03:18:28: Plugin successfully installed
03:18:28: *-*-* OGRE Initialising
03:18:28: *-*-* Version 1.6.4 (Shoggoth)
03:18:28: Creating resource group Bootstrap
03:18:28: Added resource location '../../media/packs/OgreCore.zip' of type 'Zip' to resource group 'Bootstrap'
03:18:28: Added resource location '../../media' of type 'FileSystem' to resource group 'General'
03:18:28: Added resource location '../../media/fonts' of type 'FileSystem' to resource group 'General'
03:18:28: Added resource location '../../media/materials/programs' of type 'FileSystem' to resource group 'General'
03:18:28: Added resource location '../../media/materials/scripts' of type 'FileSystem' to resource group 'General'
03:18:28: Added resource location '../../media/materials/textures' of type 'FileSystem' to resource group 'General'
03:18:28: Added resource location '../../media/models' of type 'FileSystem' to resource group 'General'
03:18:28: Added resource location '../../media/overlays' of type 'FileSystem' to resource group 'General'
03:18:28: Added resource location '../../media/particle' of type 'FileSystem' to resource group 'General'
03:18:28: Added resource location '../../media/gui' of type 'FileSystem' to resource group 'General'
03:18:28: Added resource location '../../media/DeferredShadingMedia' of type 'FileSystem' to resource group 'General'
03:18:28: Added resource location '../../media/PCZAppMedia' of type 'FileSystem' to resource group 'General'
03:18:28: Added resource location '../../media/packs/cubemap.zip' of type 'Zip' to resource group 'General'
03:18:28: Added resource location '../../media/packs/cubemapsJS.zip' of type 'Zip' to resource group 'General'
03:18:28: Added resource location '../../media/packs/dragon.zip' of type 'Zip' to resource group 'General'
03:18:28: Added resource location '../../media/packs/fresneldemo.zip' of type 'Zip' to resource group 'General'
03:18:28: Added resource location '../../media/packs/ogretestmap.zip' of type 'Zip' to resource group 'General'
03:18:28: Added resource location '../../media/packs/skybox.zip' of type 'Zip' to resource group 'General'
03:18:28: D3D9 : RenderSystem Option: Allow NVPerfHUD = No
03:18:28: D3D9 : RenderSystem Option: Anti aliasing = None
03:18:28: D3D9 : RenderSystem Option: Floating-point mode = Fastest
03:18:28: D3D9 : RenderSystem Option: Full Screen = No
03:18:28: D3D9 : RenderSystem Option: Rendering Device = NVIDIA GeForce 8400M G
03:18:28: D3D9 : RenderSystem Option: VSync = No
03:18:28: D3D9 : RenderSystem Option: Video Mode = 800 x 600 @ 32-bit colour
03:18:28: D3D9 : RenderSystem Option: sRGB Gamma Conversion = No
03:18:29: CPU Identifier & Features
03:18:29: -------------------------
03:18:29:  *   CPU ID: GenuineIntel: Intel(R) Core(TM)2 Duo CPU     T7500  @ 2.20GHz
03:18:29:  *      SSE: yes
03:18:29:  *     SSE2: yes
03:18:29:  *     SSE3: yes
03:18:29:  *      MMX: yes
03:18:29:  *   MMXEXT: yes
03:18:29:  *    3DNOW: no
03:18:29:  * 3DNOWEXT: no
03:18:29:  *     CMOV: yes
03:18:29:  *      TSC: yes
03:18:29:  *      FPU: yes
03:18:29:  *      PRO: yes
03:18:29:  *       HT: no
03:18:29: -------------------------
03:18:29: D3D9 : Subsystem Initialising
03:18:29: D3D9RenderSystem::_createRenderWindow "OGRE Render Window", 800x600 windowed  miscParams: FSAA=0 FSAAQuality=0 colourDepth=32 gamma=false useNVPerfHUD=false vsync=false 
03:18:30: D3D9 : Created D3D9 Rendering Window 'OGRE Render Window' : 800x600, 32bpp
03:18:30: D3D9 : WARNING - disabling VSync in windowed mode can cause timing issues at lower frame rates, turn VSync on if you observe this problem.
03:18:30: Registering ResourceManager for type Texture
03:18:30: Registering ResourceManager for type GpuProgram
03:18:30: D3D9: Vertex texture format supported - PF_FLOAT16_RGB
03:18:30: D3D9: Vertex texture format supported - PF_FLOAT16_RGBA
03:18:30: D3D9: Vertex texture format supported - PF_FLOAT32_RGB
03:18:30: D3D9: Vertex texture format supported - PF_FLOAT32_RGBA
03:18:30: D3D9: Vertex texture format supported - PF_FLOAT16_R
03:18:30: D3D9: Vertex texture format supported - PF_FLOAT32_R
03:18:30: D3D9: Vertex texture format supported - PF_FLOAT16_GR
03:18:30: D3D9: Vertex texture format supported - PF_FLOAT32_GR
03:18:30: RenderSystem capabilities
03:18:30: -------------------------
03:18:30: RenderSystem Name: Direct3D9 Rendering Subsystem
03:18:30: GPU Vendor: nvidia
03:18:30: Device Name: NVIDIA GeForce 8400M G
03:18:30: Driver Version: 7.15.11.119
03:18:30:  * Fixed function pipeline: yes
03:18:30:  * Hardware generation of mipmaps: yes
03:18:30:  * Texture blending: yes
03:18:30:  * Anisotropic texture filtering: yes
03:18:30:  * Dot product texture operation: yes
03:18:30:  * Cube mapping: yes
03:18:30:  * Hardware stencil buffer: yes
03:18:30:    - Stencil depth: 8
03:18:30:    - Two sided stencil support: yes
03:18:30:    - Wrap stencil values: yes
03:18:30:  * Hardware vertex / index buffers: yes
03:18:30:  * Vertex programs: yes
03:18:30:  * Fragment programs: yes
03:18:30:  * Geometry programs: no
03:18:30:  * Supported Shader Profiles: hlsl ps_1_1 ps_1_2 ps_1_3 ps_1_4 ps_2_0 ps_2_a ps_2_b ps_2_x ps_3_0 vs_1_1 vs_2_0 vs_2_a vs_2_x vs_3_0
03:18:30:  * Texture Compression: yes
03:18:30:    - DXT: yes
03:18:30:    - VTC: no
03:18:30:  * Scissor Rectangle: yes
03:18:30:  * Hardware Occlusion Query: yes
03:18:30:  * User clip planes: yes
03:18:30:  * VET_UBYTE4 vertex element type: yes
03:18:30:  * Infinite far plane projection: yes
03:18:30:  * Hardware render-to-texture: yes
03:18:30:  * Floating point textures: yes
03:18:30:  * Non-power-of-two textures: yes
03:18:30:  * Volume textures: yes
03:18:30:  * Multiple Render Targets: 4
03:18:30:    - With different bit depths: yes
03:18:30:  * Point Sprites: yes
03:18:30:  * Extended point parameters: yes
03:18:30:  * Max Point Size: 8192
03:18:30:  * Vertex texture fetch: yes
03:18:30:    - Max vertex textures: 4
03:18:30:    - Vertex textures shared: no
03:18:30:  * Render to Vertex Buffer : no
03:18:30:  * DirectX per stage constants: yes
03:18:30: ***************************************
03:18:30: *** D3D9 : Subsystem Initialised OK ***
03:18:30: ***************************************
03:18:30: ResourceBackgroundQueue - threading disabled
03:18:30: Particle Renderer Type 'billboard' registered
03:18:30: SceneManagerFactory for type 'BspSceneManager' registered.
03:18:30: Registering ResourceManager for type BspLevel
03:18:30: SceneManagerFactory for type 'PCZSceneManager' registered.
03:18:30: MovableObjectFactory for type 'PCZLight' registered.
03:18:30: PCZone Factory Type 'ZoneType_Octree' registered
03:18:30: PCZone Factory Type 'ZoneType_Terrain' registered
03:18:30: SceneManagerFactory for type 'OctreeSceneManager' registered.
03:18:30: SceneManagerFactory for type 'TerrainSceneManager' registered.
03:18:30: Parsing scripts for resource group Autodetect
03:18:30: Finished parsing scripts for resource group Autodetect
03:18:30: Parsing scripts for resource group Bootstrap
03:18:30: Parsing script OgreCore.material
03:18:30: Parsing script OgreProfiler.material
03:18:30: Parsing script Ogre.fontdef
03:18:30: Parsing script OgreDebugPanel.overlay
03:18:30: Texture: New_Ogre_Border_Center.png: Loading 1 faces(PF_A8R8G8B8,256x128x1) with  hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,256x128x1.
03:18:30: Texture: New_Ogre_Border.png: Loading 1 faces(PF_A8R8G8B8,256x256x1) with  hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,256x256x1.
03:18:30: Texture: New_Ogre_Border_Break.png: Loading 1 faces(PF_A8R8G8B8,32x32x1) with  hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,32x32x1.
03:18:30: Font BlueHighwayusing texture size 512x512
03:18:30: Info: Freetype returned null for character 127 in font BlueHighway
03:18:30: Info: Freetype returned null for character 128 in font BlueHighway
03:18:30: Info: Freetype returned null for character 129 in font BlueHighway
03:18:30: Info: Freetype returned null for character 130 in font BlueHighway
03:18:30: Info: Freetype returned null for character 131 in font BlueHighway
03:18:30: Info: Freetype returned null for character 132 in font BlueHighway
03:18:30: Info: Freetype returned null for character 133 in font BlueHighway
03:18:30: Info: Freetype returned null for character 134 in font BlueHighway
03:18:30: Info: Freetype returned null for character 135 in font BlueHighway
03:18:30: Info: Freetype returned null for character 136 in font BlueHighway
03:18:30: Info: Freetype returned null for character 137 in font BlueHighway
03:18:30: Info: Freetype returned null for character 138 in font BlueHighway
03:18:30: Info: Freetype returned null for character 139 in font BlueHighway
03:18:30: Info: Freetype returned null for character 140 in font BlueHighway
03:18:30: Info: Freetype returned null for character 141 in font BlueHighway
03:18:30: Info: Freetype returned null for character 142 in font BlueHighway
03:18:30: Info: Freetype returned null for character 143 in font BlueHighway
03:18:30: Info: Freetype returned null for character 144 in font BlueHighway
03:18:30: Info: Freetype returned null for character 145 in font BlueHighway
03:18:30: Info: Freetype returned null for character 146 in font BlueHighway
03:18:30: Info: Freetype returned null for character 147 in font BlueHighway
03:18:30: Info: Freetype returned null for character 148 in font BlueHighway
03:18:30: Info: Freetype returned null for character 149 in font BlueHighway
03:18:30: Info: Freetype returned null for character 150 in font BlueHighway
03:18:30: Info: Freetype returned null for character 151 in font BlueHighway
03:18:30: Info: Freetype returned null for character 152 in font BlueHighway
03:18:30: Info: Freetype returned null for character 153 in font BlueHighway
03:18:30: Info: Freetype returned null for character 154 in font BlueHighway
03:18:30: Info: Freetype returned null for character 155 in font BlueHighway
03:18:30: Info: Freetype returned null for character 156 in font BlueHighway
03:18:30: Info: Freetype returned null for character 157 in font BlueHighway
03:18:30: Info: Freetype returned null for character 158 in font BlueHighway
03:18:30: Info: Freetype returned null for character 159 in font BlueHighway
03:18:30: Info: Freetype returned null for character 160 in font BlueHighway
03:18:30: Texture: BlueHighwayTexture: Loading 1 faces(PF_BYTE_LA,512x512x1) with 0 generated mipmaps from Image. Internal format is PF_BYTE_LA,512x512x1.
03:18:30: Texture: ogretext.png: Loading 1 faces(PF_A8R8G8B8,256x128x1) with  hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,256x128x1.
03:18:30: Parsing script OgreLoadingPanel.overlay
03:18:30: Finished parsing scripts for resource group Bootstrap
03:18:30: Parsing scripts for resource group General
03:18:30: Parsing script DoF.program
03:18:30: Parsing script Examples.program
03:18:30: Parsing script StdQuad_vp.program
03:18:30: Parsing script Tests.program
03:18:30: Parsing script deferred.glsl.program
03:18:30: Parsing script deferred.hlsl.program
03:18:31: Parsing script deferred.program
03:18:31: Parsing script deferred_post_ambient.program
03:18:31: Parsing script deferred_post_debug.glsl.program
03:18:31: Parsing script deferred_post_debug.hlsl.program
03:18:31: Parsing script deferred_post_debug.program
03:18:31: Parsing script deferred_post_minilight.glsl.program
03:18:31: Parsing script deferred_post_minilight.hlsl.program
03:18:31: OGRE EXCEPTION(2:InvalidParametersException): Parameter called lightFalloff does not exist.  in GpuProgramParameters::_findNamedConstantDefinition at f:\codingextra\ogre\shoggoth_vc9\ogre\ogremain\src\ogregpuprogram.cpp (line 1097)
03:18:31: Compiler error: invalid parameters in deferred_post_minilight.hlsl.program(27): setting of constant failed
03:18:31: Parsing script deferred_post_minilight.program
03:18:31: Parsing script deferred_post_multipass.glsl.program
03:18:31: Parsing script deferred_post_multipass.hlsl.program
03:18:31: Parsing script deferred_post_onepass.glsl.program
03:18:31: Parsing script deferred_post_onepass.hlsl.program
03:18:31: Parsing script deferred_post_vs.program
03:18:31: Parsing script ASCII.material
03:18:31: Parsing script ASMSwizzle.material
03:18:31: Compiler error: object unsupported by render system in ASMSwizzle.material(1)
03:18:31: Parsing script BlackAndWhite.material
03:18:31: Parsing script Bloom.material
03:18:32: Parsing script Bloom2.material
03:18:32: Parsing script CGSwizzle.material
03:18:32: Parsing script DepthShadowmap.material
03:18:32: Parsing script Dither.material
03:18:32: Parsing script DOF.material
03:18:32: Parsing script DoF_ - Copy.material
03:18:32: OGRE EXCEPTION(3:RenderingAPIException): Cannot assemble D3D9 high-level shader DoF_Gaussian3x3FP_HLSL Errors:
c:\OgreSDK\bin\Debug\memory(17,14): error X3025: global variables are implicitly constant, enable compatibility mode to allow modification
 in D3D9HLSLProgram::loadFromSource at f:\codingextra\ogre\shoggoth_vc9\ogre\rendersystems\direct3d9\src\ogred3d9hlslprogram.cpp (line 199)
03:18:32: High-level program DoF_Gaussian3x3FP_HLSL encountered an error during loading and is thus not supported.
OGRE EXCEPTION(3:RenderingAPIException): Cannot assemble D3D9 high-level shader DoF_Gaussian3x3FP_HLSL Errors:
c:\OgreSDK\bin\Debug\memory(17,14): error X3025: global variables are implicitly constant, enable compatibility mode to allow modification
 in D3D9HLSLProgram::loadFromSource at f:\codingextra\ogre\shoggoth_vc9\ogre\rendersystems\direct3d9\src\ogred3d9hlslprogram.cpp (line 199)
03:18:33: OGRE EXCEPTION(3:RenderingAPIException): Cannot assemble D3D9 high-level shader DoF_DepthOfFieldFP_HLSL Errors:
c:\OgreSDK\bin\Debug\memory(24,15): error X3025: global variables are implicitly constant, enable compatibility mode to allow modification
 in D3D9HLSLProgram::loadFromSource at f:\codingextra\ogre\shoggoth_vc9\ogre\rendersystems\direct3d9\src\ogred3d9hlslprogram.cpp (line 199)
03:18:33: High-level program DoF_DepthOfFieldFP_HLSL encountered an error during loading and is thus not supported.
OGRE EXCEPTION(3:RenderingAPIException): Cannot assemble D3D9 high-level shader DoF_DepthOfFieldFP_HLSL Errors:
c:\OgreSDK\bin\Debug\memory(24,15): error X3025: global variables are implicitly constant, enable compatibility mode to allow modification
 in D3D9HLSLProgram::loadFromSource at f:\codingextra\ogre\shoggoth_vc9\ogre\rendersystems\direct3d9\src\ogred3d9hlslprogram.cpp (line 199)
03:18:33: Parsing script DoF_.material
03:18:33: Parsing script Embossed.material
03:18:33: Parsing script Example-DynTex.material
03:18:33: Parsing script Example-Water.material
03:18:33: Parsing script Example.material
03:18:33: OGRE EXCEPTION(2:InvalidParametersException): Parameter called camObjPos does not exist.  in GpuProgramParameters::_findNamedConstantDefinition at f:\codingextra\ogre\shoggoth_vc9\ogre\ogremain\src\ogregpuprogram.cpp (line 1097)
03:18:33: Compiler error: invalid parameters in Example.material(762): setting of constant failed
03:18:34: Parsing script Examples-Advanced.material
03:18:35: Parsing script facial.material
03:18:35: Parsing script Glass.material
03:18:35: Parsing script GLSLSwizzle.material
03:18:35: Parsing script Halftone.material
03:18:35: Parsing script hdr.material
03:18:35: Parsing script HeatVision.material
03:18:35: Parsing script Hurt.material
03:18:35: Parsing script instancing.material
03:18:36: Parsing script Invert.material
03:18:36: Parsing script IsoSurf.material
03:18:36: Parsing script Laplace.material
03:18:36: Parsing script MotionBlur.material
03:18:36: Parsing script MRTtest.material
03:18:36: Parsing script NightVision.material
03:18:36: Parsing script Ocean.material
03:18:37: Parsing script OffsetMapping.material
03:18:37: Parsing script Ogre.material
03:18:37: Parsing script OldMovie.material
03:18:37: Parsing script OldTV.material
03:18:37: Parsing script ParticleGS.material
03:18:37: OGRE EXCEPTION(7:InternalErrorException): Unable to compile Cg program Ogre/ParticleGS/GenerateVS: CG ERROR : The compile returned an error.
(0) : error C6015: Output 'POSITION' not completely written
 in CgProgram::loadFromSource at f:\codingextra\ogre\shoggoth_vc9\ogre\plugins\cgprogrammanager\src\ogrecgprogrammanagerdll.cpp (line 66)
03:18:37: High-level program Ogre/ParticleGS/GenerateVS encountered an error during loading and is thus not supported.
OGRE EXCEPTION(7:InternalErrorException): Unable to compile Cg program Ogre/ParticleGS/GenerateVS: CG ERROR : The compile returned an error.
(0) : error C6015: Output 'POSITION' not completely written
 in CgProgram::loadFromSource at f:\codingextra\ogre\shoggoth_vc9\ogre\plugins\cgprogrammanager\src\ogrecgprogrammanagerdll.cpp (line 66)
03:18:37: OGRE EXCEPTION(7:InternalErrorException): Unable to compile Cg program Ogre/ParticleGS/DisplayVS: CG ERROR : The compile returned an error.
(249) : warning C7050: "output.color" might be used before being initialized
(0) : error C6015: Output 'POSITION' not completely written
 in CgProgram::loadFromSource at f:\codingextra\ogre\shoggoth_vc9\ogre\plugins\cgprogrammanager\src\ogrecgprogrammanagerdll.cpp (line 66)
03:18:37: High-level program Ogre/ParticleGS/DisplayVS encountered an error during loading and is thus not supported.
OGRE EXCEPTION(7:InternalErrorException): Unable to compile Cg program Ogre/ParticleGS/DisplayVS: CG ERROR : The compile returned an error.
(249) : warning C7050: "output.color" might be used before being initialized
(0) : error C6015: Output 'POSITION' not completely written
 in CgProgram::loadFromSource at f:\codingextra\ogre\shoggoth_vc9\ogre\plugins\cgprogrammanager\src\ogrecgprogrammanagerdll.cpp (line 66)
03:18:37: OGRE EXCEPTION(7:InternalErrorException): Unable to compile Cg program Ogre/ParticleGS/DisplayPS: CG ERROR : The compile returned an error.
(323) : fatal error C9999: unexpected cast operation
 in CgProgram::loadFromSource at f:\codingextra\ogre\shoggoth_vc9\ogre\plugins\cgprogrammanager\src\ogrecgprogrammanagerdll.cpp (line 66)
03:18:37: High-level program Ogre/ParticleGS/DisplayPS encountered an error during loading and is thus not supported.
OGRE EXCEPTION(7:InternalErrorException): Unable to compile Cg program Ogre/ParticleGS/DisplayPS: CG ERROR : The compile returned an error.
(323) : fatal error C9999: unexpected cast operation
 in CgProgram::loadFromSource at f:\codingextra\ogre\shoggoth_vc9\ogre\plugins\cgprogrammanager\src\ogrecgprogrammanagerdll.cpp (line 66)
03:18:37: Parsing script Posterize.material
03:18:37: Parsing script pssm.material
03:18:37: Parsing script RadialBlur.material
03:18:37: Parsing script RZR-002.material
03:18:37: Parsing script SharpenEdges.material
03:18:38: Parsing script smoke.material
03:18:38: Parsing script Tests.material
03:18:38: Parsing script Tiling.material
03:18:38: Parsing script VarianceShadowmap.material
03:18:38: Parsing script deferred.material
03:18:38: Parsing script deferreddemo.material
03:18:38: Parsing script deferred_post_ambient.material
03:18:38: Parsing script deferred_post_debug.material
03:18:38: Parsing script deferred_post_minilight.material
03:18:38: Parsing script deferred_post_multipass.material
03:18:38: Parsing script deferred_post_onepass.material
03:18:38: Parsing script ROOM.material
03:18:38: Parsing script RomanBath.material
03:18:38: Parsing script emitted_emitter.particle
03:18:38: Parsing script Example-Water.particle
03:18:38: Parsing script Example.particle
03:18:38: Parsing script smoke.particle
03:18:38: Parsing script Dof.compositor
03:18:38: Parsing script Dof__.compositor
03:18:38: Parsing script Examples.compositor
03:18:39: Parsing script deferred.compositor
03:18:39: Parsing script sample.fontdef
03:18:39: Parsing script Compositor.overlay
03:18:39: Parsing script DoF.overlay
03:18:39: Font TrebuchetMSBoldusing texture size 512x512
03:18:39: Info: Freetype returned null for character 160 in font TrebuchetMSBold
03:18:39: Texture: TrebuchetMSBoldTexture: Loading 1 faces(PF_BYTE_LA,512x512x1) with 0 generated mipmaps from Image. Internal format is PF_BYTE_LA,512x512x1.
03:18:39: Texture: focus.png: Loading 1 faces(PF_A8R8G8B8,128x128x1) with  hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,128x128x1.
03:18:39: Parsing script DP3.overlay
03:18:39: Parsing script Example-CubeMapping.overlay
03:18:39: Parsing script Example-DynTex.overlay
03:18:39: Parsing script Example-Water.overlay
03:18:39: Parsing script Shadows.overlay
03:18:39: Finished parsing scripts for resource group General
03:18:39: Parsing scripts for resource group Internal
03:18:39: Finished parsing scripts for resource group Internal
03:18:39: Texture: RustySteel.jpg: Loading 1 faces(PF_R8G8B8,256x256x1) with  hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,256x256x1.
03:18:39: Mesh: Loading ogrehead.mesh.
03:18:39: Texture: WeirdEye.png: Loading 1 faces(PF_R8G8B8,256x256x1) with  hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,256x256x1.
03:18:39: Texture: GreenSkin.jpg: Loading 1 faces(PF_R8G8B8,256x256x1) with  hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,256x256x1.
03:18:39: Texture: spheremap.png: Loading 1 faces(PF_R8G8B8,256x256x1) with  hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,256x256x1.
03:18:39: Texture: dirt01.jpg: Loading 1 faces(PF_R8G8B8,96x96x1) with 5 generated mipmaps from Image. Internal format is PF_X8R8G8B8,96x96x1.
03:18:39: Texture: Test_Plain.png: Loading 1 faces(PF_A8R8G8B8,512x512x1) with  hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,512x512x1.
03:18:39: Texture: Test_StaticVertexProgram.png: Loading 1 faces(PF_A8R8G8B8,512x512x1) with  hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,512x512x1.
03:18:39: Texture: Test_AnimatedVertexProgram.png: Loading 1 faces(PF_A8R8G8B8,512x512x1) with  hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,512x512x1.
03:18:39: OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource DoF_Depth in resource group General or any other group. in ResourceGroupManager::openResource at f:\codingextra\ogre\shoggoth_vc9\ogre\ogremain\src\ogreresourcegroupmanager.cpp (line 763)
03:18:39: Error loading texture DoF_Depth. Texture layer will be blank. Loading the texture failed with the following exception: OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource DoF_Depth in resource group General or any other group. in ResourceGroupManager::openResource at f:\codingextra\ogre\shoggoth_vc9\ogre\ogremain\src\ogreresourcegroupmanager.cpp (line 763)
03:18:39: *** Initializing OIS ***
D3D9HLSLProgram gives some errors after parsing "DoF_Olganix.material"
CgProgram gives some errors after parsing "ParticleGS.material"

Any ideas ? (I need this demo running like yesterday. I am willing to pay :D )

Maybe if anyone has this demo up and running and is willing to share, that would be great.

Thanks in advance !
Post Reply