[osg-users] Raytraced shader code

2017-09-14 Thread Clement.Chu
Hi all,

   I am using volume rendering with ray traced technique.  I saw black color 
along the edge of image.  I checked the shader code.  There is a variable 
called fragColor and initial value is set to  vec4(0.0, 0.0, 0.0, 0.0);.  I 
would like to know why this value is using black on initial.  Should we use 
background colour for the initial?  Thanks.


Regards,
Clement Chu
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] RayTracedTechnique hangs with Intel HD Graphics - Update

2017-09-02 Thread Clement.Chu
Hi,

This is two different problems.  The length method problem is fixed since 
osg 3.2.3.  See this post http://forum.openscenegraph.org/viewtopic.php?t=15148 
for the details.

Recently, I found the problem is related to Intel graphic driver.  Specify 
on latest Intel graphic cards.  My work laptop is dell and there is no problem 
on old Intel graphic card.  Since I changed to new dell laptop with latest 
Intel graphic card, I found the problem is on gl_Vertex which value is not 
normalised and causes the crash on sampling loop.  So far I tested 5 different 
laptops with different Intel graphic cards.  Only Intel graphic card with 3 
digit version number will cause the problem (old Intel card is using 4 digit 
for version).

Regards,
Clement Chu


From: osg-users  on behalf of 
Julien Valentin 
Sent: Sunday, 3 September 2017 04:00
To: osg-users@lists.openscenegraph.org
Subject: Re: [osg-users] RayTracedTechnique hangs with Intel HD Graphics -  
Update

Hi,
it surely is the duplicate of
http://forum.openscenegraph.org/viewtopic.php?t=14304
I thought this issue was fixed since all this time
The hack i use is there
curious bug indeed, and so curious solution too
@robert
Perhaps it may be merged into master...your call...

cheers


Clement wrote:
> Hi,
>
> Finally I found where causes the problem.  For some reasons, gl_Vertex is not 
> normalized.  I looked at osg shader source code (src\osgVolume\Shaders).  For 
> example, in file volume_frag.cpp,
>
> vec4 t0 = vertexPos;
> vec4 te = cameraPos;
>
> // by default te did to check the range (0 and 1), but t0 did not.
> // If I added  some codes to check the range, then the problem is completed 
> gone.
>
> if (t0.x<0.0) t0.x = 0.0; if (t0.x>1.0) t0.x = 1.0;
> if (t0.y<0.0) t0.y = 0.0; if (t0.y>1.0) t0.y = 1.0;
> f (t0.z<0.0) t0.z = 0.0; if (t0.z>1.0) t0.z = 1.0;
>
>
> I believe the problem is related to GLSL version and latest Intel HD Graphics 
> driver is using higher version of GLSL, but gl_Vertex does not normalize or 
> the value is just over 1 or less then 0 (eg. 1.1).  Then it causes the 
> crash when running the sampling loop.  I am not an expert on GLSL, so I would 
> like to confirm the best solution to handle this problem. Thanks.
>
>
> Regards,
> Clement Chu
>
> 
> From: osg-users <> on behalf of  <>
> Sent: Wednesday, 30 August 2017 17:31
> To:
> Subject: [ExternalEmail]  RayTracedTechnique hangs with Intel HD Graphics
>
> Hi,
>
> My program uses RayTracedTechnique for volume rendering, but it hangs with 
> Intel HD graphics 520, 530 and 620. My old laptop works fine which is using 
> Intel HD Graphic 3000.  Other machines with Nvidia cards are working fine 
> too.  I believe the problem is on shaders in the sampling loop.  My program 
> is using osg 3.2.3.  I also tried to upgrade to osg 3.4.1, but the same 
> problem occurred with Intel HD Graphic 520, 530 and 620.  Do anyone have 
> similar problem and any solution to fix it?  Many thanks.
>
>
> Regards,
> Clement Chu
> ___
> osg-users mailing list
>
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> ___
> osg-users mailing list
>
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>  --
> Post generated by Mail2Forum


--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=71607#71607





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] RayTracedTechnique hangs with Intel HD Graphics - Update

2017-09-01 Thread Clement.Chu
Hi Robert,


  Since I don't know how to debug or print message in shader code, I am not 
sure what exact value of vertex.  I guess the value of vertex is not in the 
range (0.0 to 1.0), so texture3D method cannot get correct color value by 
coordinate.  In file volume_frag.cpp,  variable texcoord is assigned from 
vertex data. If vertex data is not the 0.0f to 1.0f range, variable color (type 
vec4) will become strange value.  Even I added some codes to make sure values 
of color.x, color.y, color.z and color.w  in the range (0.0 to 1.0), it still 
cause the crash. Unless vertex is in the range (0.0 to 1.0). So far, this 
problem occurs in Intel HD Graphics 520 or above.  My old laptop is Intel HD 
Graphics 3000, but it works fine and Nvidia cards work fine too.



Regards,
Clement Chu

From: osg-users  on behalf of 
Robert Osfield 
Sent: Friday, 1 September 2017 18:29
To: OpenSceneGraph Users
Subject: Re: [osg-users] RayTracedTechnique hangs with Intel HD Graphics - 
Update

Hi Clement,

The numerical issue you have found causing a crash is a curious one.

The gl_Vertex isn't a normalized on any system, osgVolume::RayTracedTechnique 
does use a unit cube for it's geometry though, so the vertex data should all be 
in the 0.0f to 1.0f range.  Perhaps the intel driver/hardware combination is 
resulting in some numerical precision issue so that the values are going 
slightly outside the 0 to 1.0f range, but even if it does I wouldn't expect the 
fragment shaders to suddenly have problems.

Is there are specific line in the shader that you think is cause the crash?

FYI, osgVolume checks for the shader/volume.vert and shader/volume.frag 
filenames first then fallsback to the built in shaders that are found in the 
src/osgVolume/Shaders/volume_frag.cpp.  The shader/volume.frag can be found in 
OpenSceneGraph-Data/shader so if you have this available and it's on the 
OSG_FILE_PATH then you should be able to edit the shader files without 
recompiling the application.

Robert.

Robert.

On 1 September 2017 at 08:11, 
> wrote:
Hi,

   Finally I found where causes the problem.  For some reasons, gl_Vertex is 
not normalized.  I looked at osg shader source code (src\osgVolume\Shaders).  
For example, in file volume_frag.cpp,

vec4 t0 = vertexPos;
vec4 te = cameraPos;

// by default te did to check the range (0 and 1), but t0 did not.
// If I added  some codes to check the range, then the problem is completed 
gone.

if (t0.x<0.0) t0.x = 0.0; if (t0.x>1.0) t0.x = 1.0;
if (t0.y<0.0) t0.y = 0.0; if (t0.y>1.0) t0.y = 1.0;
f (t0.z<0.0) t0.z = 0.0; if (t0.z>1.0) t0.z = 1.0;


I believe the problem is related to GLSL version and latest Intel HD Graphics 
driver is using higher version of GLSL, but gl_Vertex does not normalize or the 
value is just over 1 or less then 0 (eg. 1.1).  Then it causes the crash 
when running the sampling loop.  I am not an expert on GLSL, so I would like to 
confirm the best solution to handle this problem. Thanks.


Regards,
Clement Chu


From: osg-users 
>
 on behalf of clement@csiro.au 
Sent: Wednesday, 30 August 2017 17:31
To: 
osg-users@lists.openscenegraph.org
Subject: [ExternalEmail] [osg-users] RayTracedTechnique hangs with Intel HD 
Graphics

Hi,

   My program uses RayTracedTechnique for volume rendering, but it hangs with 
Intel HD graphics 520, 530 and 620. My old laptop works fine which is using 
Intel HD Graphic 3000.  Other machines with Nvidia cards are working fine too.  
I believe the problem is on shaders in the sampling loop.  My program is using 
osg 3.2.3.  I also tried to upgrade to osg 3.4.1, but the same problem occurred 
with Intel HD Graphic 520, 530 and 620.  Do anyone have similar problem and any 
solution to fix it?  Many thanks.


Regards,
Clement Chu
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] RayTracedTechnique hangs with Intel HD Graphics - Update

2017-09-01 Thread Clement.Chu
Hi,

   Finally I found where causes the problem.  For some reasons, gl_Vertex is 
not normalized.  I looked at osg shader source code (src\osgVolume\Shaders).  
For example, in file volume_frag.cpp, 

vec4 t0 = vertexPos;
vec4 te = cameraPos;

// by default te did to check the range (0 and 1), but t0 did not.
// If I added  some codes to check the range, then the problem is completed 
gone.

if (t0.x<0.0) t0.x = 0.0; if (t0.x>1.0) t0.x = 1.0; 
if (t0.y<0.0) t0.y = 0.0; if (t0.y>1.0) t0.y = 1.0; 
f (t0.z<0.0) t0.z = 0.0; if (t0.z>1.0) t0.z = 1.0; 


I believe the problem is related to GLSL version and latest Intel HD Graphics 
driver is using higher version of GLSL, but gl_Vertex does not normalize or the 
value is just over 1 or less then 0 (eg. 1.1).  Then it causes the crash 
when running the sampling loop.  I am not an expert on GLSL, so I would like to 
confirm the best solution to handle this problem. Thanks.


Regards,
Clement Chu


From: osg-users  on behalf of 
clement@csiro.au 
Sent: Wednesday, 30 August 2017 17:31
To: osg-users@lists.openscenegraph.org
Subject: [ExternalEmail] [osg-users] RayTracedTechnique hangs with Intel HD 
Graphics

Hi,

   My program uses RayTracedTechnique for volume rendering, but it hangs with 
Intel HD graphics 520, 530 and 620. My old laptop works fine which is using 
Intel HD Graphic 3000.  Other machines with Nvidia cards are working fine too.  
I believe the problem is on shaders in the sampling loop.  My program is using 
osg 3.2.3.  I also tried to upgrade to osg 3.4.1, but the same problem occurred 
with Intel HD Graphic 520, 530 and 620.  Do anyone have similar problem and any 
solution to fix it?  Many thanks.


Regards,
Clement Chu
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] RayTracedTechnique hangs with Intel HD Graphics

2017-08-30 Thread Clement.Chu
Hi,

   My program uses RayTracedTechnique for volume rendering, but it hangs with 
Intel HD graphics 520, 530 and 620. My old laptop works fine which is using 
Intel HD Graphic 3000.  Other machines with Nvidia cards are working fine too.  
I believe the problem is on shaders in the sampling loop.  My program is using 
osg 3.2.3.  I also tried to upgrade to osg 3.4.1, but the same problem occurred 
with Intel HD Graphic 520, 530 and 620.  Do anyone have similar problem and any 
solution to fix it?  Many thanks.


Regards,
Clement Chu
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Cannot rotate image on Windows 10 with osg 3.2.3

2017-06-28 Thread Clement.Chu
Hi,

  Recently, I upgraded my machine to dell e7470 with windows 10.  I am using 
osg 3.2.3.  When I tried to rotate the image, I got the following error.  
Please help.

Unhandled exception at 0x7fff4080ab96 (osg100-osgViewerd.dll) in 
myprogram.exe: 0xC005: Access violation reading location 0x.




Regards,
Clement Chu
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Pixel size

2016-05-18 Thread Clement.Chu
Hi Robert,

  Thanks for your help.  I found I can do it on osgVolume:Locator 
setTransformAsExtents method.  Thanks.


Regards,
Clement Chu


From: osg-users  on behalf of 
Robert Osfield 
Sent: Friday, 13 May 2016 19:28
To: OpenSceneGraph Users
Subject: Re: [osg-users] Pixel size

Hi Clement,

The osgVolume::Locator that you assign to the ImageLayer and
VolumeTile positioning the unit cube of the texture into object space.

Robert.

On 12 May 2016 at 08:23,   wrote:
> Hi,
>
>
>   I have a question about pixel size in volume rendering.  Is current pixel
> size 1 x 1 x 1? If the pixel is changed to 1.2 x 1.5 x 1.6, where can I set
> this information on osgVolume?  Thanks.
>
>
>
> Regards,
> Clement
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Pixel size

2016-05-12 Thread Clement.Chu
Hi,


  I have a question about pixel size in volume rendering.  Is current pixel 
size 1 x 1 x 1? If the pixel is changed to 1.2 x 1.5 x 1.6, where can I set 
this information on osgVolume?  Thanks.



Regards,
Clement

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Volume image crash on the latest version of Nvidia driver

2015-08-17 Thread Clement.Chu
Hi Robert,

  Yes.  I am using 3.2.3 since I got a problem to show image in the center on 
3.4 (My program is using MFC).  Then I used 3.2.3.



Regards,
Clement



From: osg-users [osg-users-boun...@lists.openscenegraph.org] on behalf of 
Robert Osfield [robert.osfi...@gmail.com]
Sent: Monday, 17 August 2015 17:06
To: OpenSceneGraph Users
Subject: Re: [osg-users] Volume image crash on the latest version of Nvidia 
driver

HI Clement,

Curious... but what I don't understand is how the Intel compiler was 
progressing on to the if (num_iteration!=num_iterators) as this should only be 
run on NVidia cards thank to the #idef NVIDIA_Corportion guard around it,

Are you backporting the shaders to 3,2,x?

Robert.

On 17 August 2015 at 07:33, clement@csiro.aumailto:clement@csiro.au 
wrote:
Hi Robert,

   I got funny volume display problem on intel card (it lost some opacity 
values).  I checked the shader code and I found the problem on handling NaN 
with using if statement.

Your code is :

 if (num_iterationsmin_iterations) num_iterations = 
min_iterations;\n
 else if (num_iterationsmax_iterations) 
num_iterations = max_iterations;\n
 else if (num_iterations!=num_iterations) 
num_iterations = max_iterations;\n


   I checked NaN on wiki https://en.wikipedia.org/wiki/NaN.  The non-signaling 
value won't do standard comparison, so I changed the code as below.

 if (num_iterations!=num_iterations) num_iterations = 
max_iterations;\n
 else if (num_iterationsmin_iterations) 
num_iterations = min_iterations;\n
 else if (num_iterationsmax_iterations) 
num_iterations = max_iterations;\n

  Check the value whether it is NaN on first condition and it works as normal 
on intel card now.



Regards,
Clement



From: osg-users 
[osg-users-boun...@lists.openscenegraph.orgmailto:osg-users-boun...@lists.openscenegraph.org]
 on behalf of Robert Osfield 
[robert.osfi...@gmail.commailto:robert.osfi...@gmail.com]
Sent: Wednesday, 12 August 2015 23:58
To: OpenSceneGraph Users
Subject: Re: [osg-users] Volume image crash on the latest version of Nvidia 
driver

On 12 August 2015 at 14:47, 
clement@csiro.aumailto:clement@csiro.aumailto:clement@csiro.au
 wrote:
Hi Robert,

  I have tested on both Intel and Nvidia machines.  The solution works without 
any issue.  Thanks.

I have applied this fix to OSG-svn/trunk, OSG-3.2.3 and OSG-3.4.0 so we should 
now be good to go.

Robert.


___
osg-users mailing list
osg-users@lists.openscenegraph.orgmailto:osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Volume image crash on the latest version of Nvidia driver

2015-08-17 Thread Clement.Chu
Hi Robert,

   I got funny volume display problem on intel card (it lost some opacity 
values).  I checked the shader code and I found the problem on handling NaN 
with using if statement.

Your code is :

 if (num_iterationsmin_iterations) num_iterations = 
min_iterations;\n
 else if (num_iterationsmax_iterations) 
num_iterations = max_iterations;\n
 else if (num_iterations!=num_iterations) 
num_iterations = max_iterations;\n


   I checked NaN on wiki https://en.wikipedia.org/wiki/NaN.  The non-signaling 
value won't do standard comparison, so I changed the code as below.

 if (num_iterations!=num_iterations) num_iterations = 
max_iterations;\n
 else if (num_iterationsmin_iterations) 
num_iterations = min_iterations;\n
 else if (num_iterationsmax_iterations) 
num_iterations = max_iterations;\n

  Check the value whether it is NaN on first condition and it works as normal 
on intel card now.

  

Regards,
Clement



From: osg-users [osg-users-boun...@lists.openscenegraph.org] on behalf of 
Robert Osfield [robert.osfi...@gmail.com]
Sent: Wednesday, 12 August 2015 23:58
To: OpenSceneGraph Users
Subject: Re: [osg-users] Volume image crash on the latest version of Nvidia 
driver

On 12 August 2015 at 14:47, clement@csiro.aumailto:clement@csiro.au 
wrote:
Hi Robert,

  I have tested on both Intel and Nvidia machines.  The solution works without 
any issue.  Thanks.

I have applied this fix to OSG-svn/trunk, OSG-3.2.3 and OSG-3.4.0 so we should 
now be good to go.

Robert.


___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Volume image crash on the latest version of Nvidia driver

2015-08-12 Thread Clement.Chu
Hi Robert,

  I have tested on both Intel and Nvidia machines.  The solution works without 
any issue.  Thanks.


Regards,
Clement



From: osg-users [osg-users-boun...@lists.openscenegraph.org] on behalf of 
Robert Osfield [robert.osfi...@gmail.com]
Sent: Tuesday, 11 August 2015 18:07
To: OpenSceneGraph Users
Subject: Re: [osg-users] Volume image crash on the latest version of Nvidia 
driver

Hi Clement,

On 11 August 2015 at 08:02, clement@csiro.au wrote:

   I found opengl api  https://www.opengl.org/sdk/docs/man/.  I think most of 
 systems should support it.

On my search I came across suggestion of lack of support on OSX and
GLES. I don't know how correct/up to date this is.

Could you try replacing the

   if (isnan(num_iterations)) num_iterations = 2.0;

With:

   if (num_iterations!=num_iterations) num_iterations = 2.0;

I would try myself by my system that had the latest NVIdia drivers
that show this bug has died due to a disk failure.  I will need to buy
and new disk and get everything back installed on it.  This isn't
something I can tackle today though.

Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Volume image crash on the latest version of Nvidia driver

2015-08-11 Thread Clement.Chu
Hi Robert,

  I found opengl api  https://www.opengl.org/sdk/docs/man/.  I think most of 
systems should support it.


Regards,
Clement



From: osg-users [osg-users-boun...@lists.openscenegraph.org] on behalf of 
Robert Osfield [robert.osfi...@gmail.com]
Sent: Tuesday, 11 August 2015 16:53
To: OpenSceneGraph Users
Subject: Re: [osg-users] Volume image crash on the latest version of Nvidia 
driver

HI Clement,

Good investigation.  This suggested workaround would sure be cleaner than my 
approach of toggling between float and int types.  The only problem with it 
would be how widely the isnan is supported.  I've done a quick internet search 
and haven't come up with a clear answer, it would seem there are systems that 
don't support it.

Robert.

On 11 August 2015 at 06:51, clement@csiro.aumailto:clement@csiro.au 
wrote:
Hi Robert,

   Finally, I found out where causes the crash problem.  The problem is not 
related to the type casting.  See the source code below:

float num_iterations = ceil(length((te-t0).xyz)/SampleDensityValue);


   The problem is the value of num_iterations is a NaN float value (not a 
number), so that why it makes an infinite running in the loop and then crashed. 
 I think the problem is on the method length().  In some condition (different 
values of t0 and te) makes the method length() to return a NaN value.  I added 
a line of code to check variable num_iterations.

  if (isnan(num_iterations)) num_iterations = 2.0;


  So far it works on both nvidia and intel cards.



Regards,
Clement



From: osg-users 
[osg-users-boun...@lists.openscenegraph.orgmailto:osg-users-boun...@lists.openscenegraph.org]
 on behalf of Robert Osfield 
[robert.osfi...@gmail.commailto:robert.osfi...@gmail.com]
Sent: Monday, 10 August 2015 17:42
To: OpenSceneGraph Users
Subject: Re: [osg-users] Volume image crash on the latest version of Nvidia 
driver

Hi Clement,

I have been looking GLSL for what might help us determine when to use float vs 
ints.  The follow info might be useful:

   https://github.com/mattdesl/lwjgl-basics/wiki/GLSL-Versions

Perhaps we should just add a #version 130 (OpenGL Version = 3.0) to the top of 
the fragment shaders to make sure they support ints.  This may mean that the 
Intel driver fails though.

What Intel hardware, drivers and OpenGL version support by the drivers do you 
have on your system?

Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.orgmailto:osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Volume image crash on the latest version of Nvidia driver

2015-08-10 Thread Clement.Chu
Hi Robert,

   Finally, I found out where causes the crash problem.  The problem is not 
related to the type casting.  See the source code below:

float num_iterations = ceil(length((te-t0).xyz)/SampleDensityValue);


   The problem is the value of num_iterations is a NaN float value (not a 
number), so that why it makes an infinite running in the loop and then crashed. 
 I think the problem is on the method length().  In some condition (different 
values of t0 and te) makes the method length() to return a NaN value.  I added 
a line of code to check variable num_iterations.

  if (isnan(num_iterations)) num_iterations = 2.0;


  So far it works on both nvidia and intel cards.



Regards,
Clement



From: osg-users [osg-users-boun...@lists.openscenegraph.org] on behalf of 
Robert Osfield [robert.osfi...@gmail.com]
Sent: Monday, 10 August 2015 17:42
To: OpenSceneGraph Users
Subject: Re: [osg-users] Volume image crash on the latest version of Nvidia 
driver

Hi Clement,

I have been looking GLSL for what might help us determine when to use float vs 
ints.  The follow info might be useful:

   https://github.com/mattdesl/lwjgl-basics/wiki/GLSL-Versions

Perhaps we should just add a #version 130 (OpenGL Version = 3.0) to the top of 
the fragment shaders to make sure they support ints.  This may mean that the 
Intel driver fails though.

What Intel hardware, drivers and OpenGL version support by the drivers do you 
have on your system?

Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Volume image crash on the latest version of Nvidia driver

2015-08-09 Thread Clement.Chu
Hi Robert,

   I have tested again on some machines with Intel graphic cards.  The new 
change works on even both old and new nvidia drivers, but it does not work on 
Intel card.  There is no image showed on display with using Intel card.  You 
can reproduce the problem with the same test file on Intel graphic card.  Does 
any method make both Intel and Nvidia drivers working properly?  Thanks.



Regards,
Clement


From: osg-users [osg-users-boun...@lists.openscenegraph.org] on behalf of 
Robert Osfield [robert.osfi...@gmail.com]
Sent: Thursday, 6 August 2015 21:32
To: OpenSceneGraph Users
Subject: Re: [osg-users] Volume image crash on the latest version of Nvidia 
driver

Hi Clement,

I have now ported the RayTracedTechnique shaders all across to use an int 
variable for the sampling loop and this fixes the hang when running with your 
model.  I have checked this fix into OSG-svn/trunk, 3.4 branch and 3.2 branch 
and OpenSceneGraph-Data/trunk.  This fix will required a OSG-3.2.3 release.

Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Volume image crash on the latest version of Nvidia driver

2015-08-06 Thread Clement.Chu
Hi Robert,

   Thanks for your help.  The solution fixed the problem.  Thanks.


Regards,
Clement


From: osg-users [osg-users-boun...@lists.openscenegraph.org] on behalf of 
Robert Osfield [robert.osfi...@gmail.com]
Sent: Thursday, 6 August 2015 21:32
To: OpenSceneGraph Users
Subject: Re: [osg-users] Volume image crash on the latest version of Nvidia 
driver

Hi Clement,

I have now ported the RayTracedTechnique shaders all across to use an int 
variable for the sampling loop and this fixes the hang when running with your 
model.  I have checked this fix into OSG-svn/trunk, 3.4 branch and 3.2 branch 
and OpenSceneGraph-Data/trunk.  This fix will required a OSG-3.2.3 release.

Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Volume image crash on the latest version of Nvidia driver

2015-08-05 Thread Clement.Chu
Hi Robert,

  The problem may be related to Nvidia driver.  I tested on my laptop (Nvidia 
NVS 5200M) with driver 353.62 and deskop (Nvidia Quadro 2000) with driver 
353.62.  Both machines have the crash problem.  I also tested the crash problem 
starting from the driver version 343.

  My application is using window MFC.  There is no crash when the volume data 
is loaded.  Once I started to rotate the image, it will crash the whole 
application.  I also exported my volume data into dds format using (osg write 
image method).  When I used osgviewer.exe to load the dds image, the crash 
problem also occurred if I rotated the image.  I cannot run the osg volume data 
sample, but there is no crash problem with using others osg example data.  I 
will try OSG-3.4.0-rc later.


Regards,
Clement


From: osg-users [osg-users-boun...@lists.openscenegraph.org] on behalf of 
Robert Osfield [robert.osfi...@gmail.com]
Sent: Wednesday, 5 August 2015 16:52
To: OpenSceneGraph Users
Subject: Re: [osg-users] Volume image crash on the latest version of Nvidia 
driver

Hi Clement and Julien,

On 5 August 2015 at 02:12, clement@csiro.aumailto:clement@csiro.au 
wrote:
Hi Julien,

   I am using osg stable release 3.2.1 64 bit windows version.  Did you solve 
the problem so far?

Can you create the problem with any of the standard OSG examples?

If not could you create a small example that illustrates the problem.

Trying out one of the OSG-3.4.0-rc as well as the OpenSceneGraph-Data in 
svn/trunk.  I'll make a new OpenSceneGraph-Data for OSG-3.4.0.

Robert.

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Volume image crash on the latest version of Nvidia driver

2015-08-04 Thread Clement.Chu
Hi,

   I got a crash problem on volume rendering on Windows with using the latest 
Nvidia driver which is 353.62.  Previously I am using version 341 without any 
problem.  Have anyone got the same problem?


Regards,
Clement

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Volume image crash on the latest version of Nvidia driver

2015-08-04 Thread Clement.Chu
Hi Julien,

   I am using osg stable release 3.2.1 64 bit windows version.  Did you solve 
the problem so far?


Regards,
Clement



From: osg-users [osg-users-boun...@lists.openscenegraph.org] on behalf of 
Julien Valentin [julienvalenti...@gmail.com]
Sent: Wednesday, 5 August 2015 09:33
To: osg-users@lists.openscenegraph.org
Subject: Re: [osg-users] Volume image crash on the latest version of Nvidia 
driver

i had the same issue:
http://forum.openscenegraph.org/viewtopic.php?t=14304

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=64619#64619





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] View volume image on web

2015-05-21 Thread Clement.Chu
Hi Émeric,

  Thanks for your information.  I am thinking whether it is easy way to show 
the volume image on web page.  I also found some examples using texture2d to 
form volume rendering.  I may try this option.  Thanks.


Regards,
Clement





From: osg-users [osg-users-boun...@lists.openscenegraph.org] on behalf of 
Émeric MASCHINO [emeric.masch...@gmail.com]
Sent: Thursday, 21 May 2015 18:52
To: OpenSceneGraph Users
Subject: Re: [osg-users] View volume image on web

Hi Clement,

If by volume, you mean voxels, then you're out of luck, as OpenGL ES,
which WebGL relies upon, lacks of 3D texture support [1]. This is
something WebGL 2.0 is supposed to solve. In the meantime, there seems
to be a trick involving GLSL [2] but I didn't look deep into the
code/solution.

BTW, how did you use WebGL with OSG? I know of OSG.JS [3], a
JavaScript reimplementation of OSG API aiming to develop WebGL
applications, but that's a totally different project.

[1] 
https://www.khronos.org/message_boards/showthread.php/7225-3D-textures-in-WebGL
[2] 
http://gamedev.stackexchange.com/questions/34110/how-can-i-implement-3d-textures-using-webgl
[3] http://osgjs.org

 Émeric


2015-05-21 4:30 GMT+02:00  clement@csiro.au:
 Hi,

I saved my volume image data as dds format by using osgDB::writeImage 
 method.  Does anyone know any method to be able to show dds image on webpage? 
  I tried webgl and it does not work.  I am not sure whether webgl supports 
 volume rendering or not.  Thanks.


 Regards,
 Clement



 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] View volume image on web

2015-05-20 Thread Clement.Chu
Hi,

   I saved my volume image data as dds format by using osgDB::writeImage 
method.  Does anyone know any method to be able to show dds image on webpage?  
I tried webgl and it does not work.  I am not sure whether webgl supports 
volume rendering or not.  Thanks.


Regards,
Clement



___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Write to dicom format

2015-05-19 Thread Clement.Chu
Hi,

   I am wondering whether osg can save volume image as dicom format.  I tried 
both osgDB::writeNodeFile or osgDB::writeImageFile not working.  I have 
compiled the osgdb_dicom.lib plugin.  I checked the source code, it has read 
method only.  Anyone know how to do it?  Thanks.


Regards,
Clement



___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Remote Deskstop Display issue

2015-03-04 Thread Clement.Chu
Hi Alistair,

Thanks for your details answer.  I will try option 3.  Thanks.


Regards,
Clement





From: osg-users [osg-users-boun...@lists.openscenegraph.org] on behalf of 
Alistair Baxter [alist...@mve.com]
Sent: Wednesday, 4 March 2015 21:50
To: OpenSceneGraph Users
Subject: Re: [osg-users] Remote Deskstop Display issue

Your remote display problem is a limitation of Windows Remote Desktop's OpenGL 
support. There are three potential solutions:

1) Only use OpenGL 1.1 features if you're using remote desktop - not very 
practical possibly not even possible with OpenSceneGraph.

2) Use ANGLE and OpenGL ES - Angle is a wrapper for Direct3D that exposes the 
OpenGL ES 2.0 and 3.0 API. Direct3D works across RDP, but only from windows 7 
SP1, or the equivalent server version via a technology called RemoteFX. This 
also will require rebuilding OpenSceneGraph, and writing your own replacement 
for GraphicsWindowWin32 using GraphicsWindoEmbedded and EGL (or QT 5). Also 
you'll be restricted to OpenGL Es's feature-set.

3) Use Mesa. If you can get builds of OPENGL32.DLL and GLU32.DLL for Mesa, you 
can just drop them into your executable directory, and your app will support 
desktop OpenGL 2.1 using software rendering. You'll need to remove those two 
dlls to return to using proper desktop OpenGL. Obviously that's awkward, and 
Mesa is slow and restricted in features compared to full, modern desktop OpenGL 
(although conveniently it's a similar feature set to compatibility mode on OSX).

Internally, we use option 2 and option 3 on different products.


Your only other alternative is to use a different remote desktop protocol 
product, like VNC or something commercial.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Remote Deskstop Display issue

2015-03-04 Thread Clement.Chu
Hi Alistair,

   I forgot to ask a question.  Remote desktop works on the machine which has 
Nivida Quadro display card installed.  Do you know why it works probably?
   

Regards,
Clement





From: osg-users [osg-users-boun...@lists.openscenegraph.org] on behalf of 
Alistair Baxter [alist...@mve.com]
Sent: Wednesday, 4 March 2015 21:50
To: OpenSceneGraph Users
Subject: Re: [osg-users] Remote Deskstop Display issue

Your remote display problem is a limitation of Windows Remote Desktop's OpenGL 
support. There are three potential solutions:

1) Only use OpenGL 1.1 features if you're using remote desktop - not very 
practical possibly not even possible with OpenSceneGraph.

2) Use ANGLE and OpenGL ES - Angle is a wrapper for Direct3D that exposes the 
OpenGL ES 2.0 and 3.0 API. Direct3D works across RDP, but only from windows 7 
SP1, or the equivalent server version via a technology called RemoteFX. This 
also will require rebuilding OpenSceneGraph, and writing your own replacement 
for GraphicsWindowWin32 using GraphicsWindoEmbedded and EGL (or QT 5). Also 
you'll be restricted to OpenGL Es's feature-set.

3) Use Mesa. If you can get builds of OPENGL32.DLL and GLU32.DLL for Mesa, you 
can just drop them into your executable directory, and your app will support 
desktop OpenGL 2.1 using software rendering. You'll need to remove those two 
dlls to return to using proper desktop OpenGL. Obviously that's awkward, and 
Mesa is slow and restricted in features compared to full, modern desktop OpenGL 
(although conveniently it's a similar feature set to compatibility mode on OSX).

Internally, we use option 2 and option 3 on different products.


Your only other alternative is to use a different remote desktop protocol 
product, like VNC or something commercial.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Remote Deskstop Display issue

2015-03-03 Thread Clement.Chu
Hi,

   Recently, I found a display problem with using remote desktop connection.  
If I used RDC connected to remote machine and then start the an application 
with embed osg viewer, the viewer cannot display volume image probably (empty 
image).  If the application is already started at remote machine before RDC 
connection, the volume image can display probably and everything working fine.

  I think the problem may relate to opengl32 library.  If the application is 
started after RDC connection, then osg will load opengl32 library which is 
based on RDC generic display driver.  That driver cannot osg volume image.  I 
also tested with the machine which has nvidia quadro installed.  The problem is 
gone even before or after RDC connection to start the application.  Does anyone 
have a solution to solve this problem?  Is possible to force osg is not using 
generic display driver?  Thanks.


Regards,
Clement



___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] writeNodeFile question

2015-03-01 Thread Clement.Chu
Hi,

   I have a question about using writeNodeFile to write volume image into file. 
 Currently, my volume image is reading from external file.  I would like to 
write whole osg scene data into file.  Then I can use osgviewer or other viewer 
to load the file.  My question is the output file does not contain any image 
data.  Anyone know how to do?  Thanks.


Regards,
Clement



___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] WriteNodeFile with Voume question

2015-02-16 Thread Clement.Chu
Hi All,

   I would like to know how to save the volume image in osgviewer into file.  I 
used a method osgDB::writeNodeFile(*_osgViewer-getSceneData(), 
testfile.osg).  The output file size is small and it does not contain volume 
data.  I would like to know how to save to file include all volume data.  From 
the output file, there is no osgImage inside ImageLayer.  Do I need to add some 
options into writeNodeFile and what is it?  Many thanks for your help.  Thanks.


This is the output file content:

osgVolume::Volume {
  UniqueID Volume_0
  nodeMask 0x
  cullingActive TRUE
  StateSet {
UniqueID StateSet_1
DataVariance STATIC
rendering_hint DEFAULT_BIN
renderBinMode INHERIT
GL_LIGHTING ON
  }
  num_children 1
  osgVolume::VolumeTile {
nodeMask 0x
cullingActive TRUE
osgVolume::Locator {
  UniqueID Locator_2
  Transform {
350 0 0 0
0 350 0 0
0 0 60 0
-175 -175 -30 1
  }
}
osgVolume::ImageLayer {
  Use Locator_2
  osgVolume::CompositeProperty {
osgVolume::AlphaFuncProperty {
  name AlphaFuncValue
  value 0
}
osgVolume::TransparencyProperty {
  name TransparencyValue
  value 1
}
osgVolume::SampleDensityProperty {
  name SampleDensityValue
  value 0.0049988824129
}
  }
}
osgVolume::RayTracedTechnique {
}
  }
}


Regards,
Clement



___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Blank screen

2015-01-30 Thread Clement.Chu
Hi all,

  I am trying to output my volume image on full screen with MFC by changing 
GraphicsContext in camera.  First I get GraphicsContext from camera and then 
close it.  Then I created a new GraphicsContext with setting screen number and 
size of full screen and then set it to camera.  It works to show full screen 
and also restore back to mfc window, but the image cannot show probably.  There 
is no image on screen (volume data) and show the axes I drawn only.  If I 
changed the display setting to stereo (Anaglyphic) and set grayscale on and 
off.  Then the image will come out.  I am not sure how to fix it.  See if 
anyone can help me.  Thanks.


Regards,
Clement



___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] 答复: Blank screen

2015-01-30 Thread Clement.Chu
Hi Robert,

  This is the code for showing image in MFC window. (I followed the 
osgviewerMFC example).

osg::ref_ptrosg::GraphicsContext::Traits traits = new 
osg::GraphicsContext::Traits;
traits-x = 0;
traits-y = 0;
traits-windowDecoration = false;
traits-doubleBuffer = true;
traits-sharedContext = 0;
traits-setInheritedWindowPixelFormat = true;
traits-width = rect.right - rect.left;
traits-height = rect.bottom - rect.top;
traits-inheritedWindowData = new 
osgViewer::GraphicsWindowWin32::WindowData(m_hWnd); 
osg::ref_ptrosg::GraphicsContext gc = 
osg::GraphicsContext::createGraphicsContext(traits.get());
osgCamera-setGraphicsContext(gc.get());

It requires to set window handle (HWND) into Trait to show image into MFC 
window.  The window decoration is already set to false.  If I changed the size, 
the osgViewer is still inside the MFC window.  I would like to switch the 
osgviewer to display on external monitor (full screen) programmatically.  I 
tried many methods and seems I can do it with creating a new GraphicsContext 
and new Trait without assign any HWND and specify the screen number, such as...

osg::GraphicsContext::WindowingSystemInterface* wsi = 
osg::GraphicsContext::getWindowingSystemInterface();
osg::GraphicsContext::ScreenIdentifier si;
si.readDISPLAY();
traits-hostName = si.hostName;
traits-displayNum = si.displayNum;
traits-screenNum = si.screenNum;


The method seems working fine, but the image is already blank at the first.  
Once I changed DisplaySettings with grayscale and stereo mode, the image will 
come out properly.  I would like to know why replaced a new GraphicsContext 
with existing camera will cause the blank problem and why the image can show up 
again after changing some display settings.  Or I already did a wrong way to 
switch the current viewer to show on full screen.  Please advise.  Thanks.



Regards,
Clement





发件人: osg-users [osg-users-boun...@lists.openscenegraph.org] 代表 Robert Osfield 
[robert.osfi...@gmail.com]
发送时间: 2015年1月31日 03:18
收件人: OpenSceneGraph Users
主题: Re: [osg-users] Blank screen

Hi Clement,

My guess is that way you hacking the screen size change by creating a new 
context is screwing up the way context ID's and OpenGL objects are managed.

My recommendation would be to just switch off window decoration and change the 
window size of the context rather than creating a new one.

Robert.

On 30 January 2015 at 16:04, 
clement@csiro.aumailto:clement@csiro.au wrote:
Hi all,

  I am trying to output my volume image on full screen with MFC by changing 
GraphicsContext in camera.  First I get GraphicsContext from camera and then 
close it.  Then I created a new GraphicsContext with setting screen number and 
size of full screen and then set it to camera.  It works to show full screen 
and also restore back to mfc window, but the image cannot show probably.  There 
is no image on screen (volume data) and show the axes I drawn only.  If I 
changed the display setting to stereo (Anaglyphic) and set grayscale on and 
off.  Then the image will come out.  I am not sure how to fix it.  See if 
anyone can help me.  Thanks.


Regards,
Clement



___
osg-users mailing list
osg-users@lists.openscenegraph.orgmailto:osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Redistribution

2014-01-28 Thread Clement.Chu
Hi all,

   Do I need to pay any patent fee or another fee if my commercial program is 
using OSG for 3D display?  Thanks.


Regards,
Clement
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Redistribution

2014-01-28 Thread Clement.Chu
Thanks for your reply.  I am worried about FFMpeg.  Since OSG is using ffmpeg 
on some functions, some patented algorithms are used inside ffmpeg.  Even my 
program won't call ffmpeg any function, but I am worried OSG includes ffmpeg 
and OSG may have a risk on include patented algorithm.  Does OSG separate from 
ffmpeg? Thanks.


Regards,
Clement

From: osg-users-boun...@lists.openscenegraph.org 
[osg-users-boun...@lists.openscenegraph.org] on behalf of Ivan Nikolaev 
[void...@develer.com]
Sent: Tuesday, 28 January 2014 20:54
To: osg-users@lists.openscenegraph.org
Subject: Re: [osg-users] Redistribution

On 01/28/2014 10:51 AM, clement@csiro.aumailto:clement@csiro.au wrote:
Hi all,

   Do I need to pay any patent fee or another fee if my commercial program is 
using OSG for 3D display?  Thanks.


Regards,
Clement

Hi,
standing to OSGPL license ( 
http://www.openscenegraph.org/index.php/about/licensing), you can freely use 
OSG in your proprietary products without paying any fee.

--
Ivan Nikolaev
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Antialiasing in Volume rendering

2012-06-25 Thread Clement.Chu
Thanks, Robert.

I attached two screen shots.  I found that aliasing would only appears on the 
side of the cube that has not been filled.  For example, the cube size is 100 x 
100 x 20.  If the cube is fully filled colour on all voxels, there is no 
aliasing on each surface.  Once there is a section of voxels has not been 
filled colour, you can see aliasing from this section.  I tried to increase the 
sample density, the colour becomes darker but the aliasing problem has not gone.


Regards,
Clement



From: osg-users-boun...@lists.openscenegraph.org 
[osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield 
[robert.osfi...@gmail.com]
Sent: Monday, 25 June 2012 6:29 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Antialiasing in Volume rendering

Hi Clement,

On 24 June 2012 18:14,  clement@csiro.au wrote:
   I got aliasing problem on volume rendering.  I tried to set parameter 
 samples to 8 in class osg::GraphicsContext::Traits, but I still can see 
 aliasing.  Does anyone have an solution to stop aliasing.  Thanks.

Volume rendering won't tend to be too sensitive/responsive to full
screen anti-aliasing, rather then the way to improve visual quality
with volume rendering is to increase the number of samples taken along
the ray path when sampling the 3d texture.

Could you post an example of the aliasing you are seeing, this will
probably point to the problem.

Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Antialiasing in Volume rendering

2012-06-25 Thread Clement.Chu
Hi Robert,

  If I extended the RayTracedTechnique and override the default VERTEX and 
FRAGMENT glsl codes to replace my own glsl code, which will measure distance 
along the ray.  Are you talking about this case to overcome the aliasing 
artifact ?  


Regards,
Clement

From: osg-users-boun...@lists.openscenegraph.org 
[osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield 
[robert.osfi...@gmail.com]
Sent: Tuesday, 26 June 2012 4:41 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Antialiasing in Volume rendering

Hi Clement,

The datasets you are working of will always challenge a ray traced
sampler as there is sudden cutoff to a flat face so that any small
change in adjacent pixels can result in a enough of different sampling
as to result in a visible step.  Increasing sample density will
usually reduce the step and make it less obvious but unless you go sub
pixel it will likely remain visible.

Another route one could go is to use a different shader that samples
at texel centers rather than just a measured distance along the ray as
is done with the present shaders.

Also I think you'll find that this aliasing artefacts will be far less
noticeable on more normal volume datasets so it may be worth just
making a judgment call about whether these datasets are meaningful and
worthy of trying to optimize for.

Robert.

On 25 June 2012 17:55,  clement@csiro.au wrote:
 Hi Robert,

   Thanks for your advice.  It looks better if I increased sample density.  
 When I tried on another case, see the attachment.  If colour is filled in 
 center section only and increased the sample density, the aliasing became 
 much worse.  If I decreased the sample density, it looks better.  Dp you know 
 when should I adjust the sample density to reduce aliasing?


 Regards,
 Clement
 
 From: osg-users-boun...@lists.openscenegraph.org 
 [osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield 
 [robert.osfi...@gmail.com]
 Sent: Tuesday, 26 June 2012 1:34 AM
 To: OpenSceneGraph Users
 Subject: Re: [osg-users] Antialiasing in Volume rendering

 Hi Clement,

 On 25 June 2012 13:29,  clement@csiro.au wrote:
 Sorry, I forget to attach the images.

 Top image:  there is no aliasing.
 Bottom image:  aliasing appears on the side that has not been filled colour.

 As I suspected the aliasing is down to under sampling of the ray, so
 up the sample ratio.

 Robert.
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Antialiasing in Volume rendering

2012-06-24 Thread Clement.Chu
Hi,

   I got aliasing problem on volume rendering.  I tried to set parameter 
samples to 8 in class osg::GraphicsContext::Traits, but I still can see 
aliasing.  Does anyone have an solution to stop aliasing.  Thanks.


Regards,
Clement
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] osgvolume brightness and sample density

2012-05-14 Thread Clement.Chu
Hi Robert,

   I would like to know how to generate colour map.  Except rgb, the alpha is 
very important, so each colour I would like to use much alpha.


If there is 1 colour, I can do like this.

 osg::TransferFunction1D::ColorMap colorMap;
 for (int i=0; i255; i++)
colorMap[i] = osg::Vec4((float)r/255, (float)g/255, 
(float)b/255, (float)i/255);
 

   If the colour are more than 10, what the colour map looks like?


Currently, I am using osgVolume without created colour map, but I believe 
there is somewhere defined the colour map.  Do you know where I can find the 
code?  Thanks again.


Regards,
Clement
 


  


From: osg-users-boun...@lists.openscenegraph.org 
[osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield 
[robert.osfi...@gmail.com]
Sent: Monday, 14 May 2012 9:07 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] osgvolume brightness and sample density

Hi Clement,

On 8 May 2012 08:44,  clement@csiro.au wrote:
  Thanks for your help.  The colour map in the osgvolume.cpp example contains 
 specific colour.  I would like to implement full range of colours as possible 
 supported by osg.  Any idea what I can do to create a colour map of full 
 range colours.  Thanks.

I don't know what you actually mean by a colour map of full range
colours, so can't answer your question.  What are you intending here,
to map the intensity values from the 3d image data to a specific
colour, which is what the TransferFunction1D is for, or from colour to
colour which is rather more open ended.

Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Volume image cannot display properly on MFC

2012-05-14 Thread Clement.Chu
After I increased sample density, the aliasing issue seems decrease.  If I 
increased too much sample density, the image movement become very difficult.  
Also the surface will become very dark.  Anyway to make the surface more 
brighter.  This is the problem I mentioned before and you suggested me to use 
TransferFunction to control light intensity. Is that right?


Clement



From: osg-users-boun...@lists.openscenegraph.org 
[osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield 
[robert.osfi...@gmail.com]
Sent: Monday, 14 May 2012 11:46 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Volume image cannot display properly on MFC

Hi Clement,

 I have another question related to osgVolume image.  My image showed ring 
 aliasing on the surface.  If the volume size is (x, y, z ) 200 * 200 * 100, 
 then assign data from pointer (100 * 100 * 50) to (100 * 100 * 51) to green.  
 The problem will show.  Please see the attachment of image.  It should be all 
 green.

This looks like an aliasing issue within the ray tracing.  Try upping
the sample density.

Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] osgvolume brightness and sample density

2012-05-14 Thread Clement.Chu
Hi Robert,

   I am not new in programming but I am new in doing 3D work.  I tried to 
generate a hugh colour map as 65535 colours and assign into 
osg::TransferFunction1D::ColorMap, but the colour display is not much better 
than I don't create colour map.  I am thinking how osg to generate default 
colour map.


Clement




From: osg-users-boun...@lists.openscenegraph.org 
[osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield 
[robert.osfi...@gmail.com]
Sent: Monday, 14 May 2012 11:22 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] osgvolume brightness and sample density

Hi Clement,

This really isn't an OSG question, or at least answering isn't an OSG
question, it's really one of how to teach you how to program.  You
have a for loop with a constant r,g,b value and varying i value and
you are stuck on how to vary r,g,b.  How about using arrays for them?
There are so many ways you can do but only YOU can answer how you want
to provide the colours and how you want to map them.  This type of
problem really is a pretty basic programming issue that isn't anything
todo with the OSG, and something I would have expect most engineers to
know how to do quite early in their careers.

I have to ask are you new to programming?  It might be we that can
suggest some general background reading to help you on your way.

Robert.

On 14 May 2012 14:00,  clement@csiro.au wrote:
 Hi Robert,

   I would like to know how to generate colour map.  Except rgb, the alpha is 
 very important, so each colour I would like to use much alpha.


If there is 1 colour, I can do like this.

 osg::TransferFunction1D::ColorMap colorMap;
 for (int i=0; i255; i++)
colorMap[i] = osg::Vec4((float)r/255, (float)g/255, 
 (float)b/255, (float)i/255);


   If the colour are more than 10, what the colour map looks like?


Currently, I am using osgVolume without created colour map, but I believe 
 there is somewhere defined the colour map.  Do you know where I can find the 
 code?  Thanks again.


 Regards,
 Clement





 
 From: osg-users-boun...@lists.openscenegraph.org 
 [osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield 
 [robert.osfi...@gmail.com]
 Sent: Monday, 14 May 2012 9:07 PM
 To: OpenSceneGraph Users
 Subject: Re: [osg-users] osgvolume brightness and sample density

 Hi Clement,

 On 8 May 2012 08:44,  clement@csiro.au wrote:
  Thanks for your help.  The colour map in the osgvolume.cpp example contains 
 specific colour.  I would like to implement full range of colours as 
 possible supported by osg.  Any idea what I can do to create a colour map of 
 full range colours.  Thanks.

 I don't know what you actually mean by a colour map of full range
 colours, so can't answer your question.  What are you intending here,
 to map the intensity values from the 3d image data to a specific
 colour, which is what the TransferFunction1D is for, or from colour to
 colour which is rather more open ended.

 Robert.
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] osgvolume brightness and sample density

2012-05-08 Thread Clement.Chu
Hi Robert,

  Thanks for your help.  The colour map in the osgvolume.cpp example contains 
specific colour.  I would like to implement full range of colours as possible 
supported by osg.  Any idea what I can do to create a colour map of full range 
colours.  Thanks.


Regards,
Clement 



From: osg-users-boun...@lists.openscenegraph.org 
[osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield 
[robert.osfi...@gmail.com]
Sent: Saturday, 5 May 2012 5:01 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] osgvolume brightness and sample density

HI Clement,

On 4 May 2012 19:30,  clement@csiro.au wrote:
   Thanks again for your reply.  I am a bit confused on using color map.  I 
 would like my program to support at least 8 bit color, so how should I create 
 the color map?  Where can I find more information?  osgvolume.cpp does not 
 have much details related to color map.

You just assign colours to the TransferFunction1D. Go have a look at
the API, the osgvolume.cpp provides code that does it.  This stuff
should be realtively straightforward to infer from the code you have
in front of you.  If you are struggling then perhaps it's time you
went back to basics a bit more w.r.t OpenGL and C++ as none of this is
particular advanced.   I'm happy to point you in the right direction,
but it's really not my place to teach you how to program computer
graphics applications.

Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] osgvolume brightness and sample density

2012-05-04 Thread Clement.Chu
Hi Robert,

Sorry, I just saw your reply.  Is TransferFunctionProperty used for defined 
colour map?

osg::ref_ptrosg::TransferFunction1D transferFunction = new 
osg::TransferFunction1D;
transferFunction-setColor(0.0, osg::Vec4(1.0,0.0,0.0,0.0));
transferFunction-setColor(0.5, osg::Vec4(1.0,1.0,0.0,0.5));
transferFunction-setColor(1.0, osg::Vec4(0.0,0.0,1.0,1.0));

transferFunction-assign(transferFunction-getColorMap());
osg::ref_ptrosgVolume::TransferFunctionProperty tfp = new 
osgVolume::TransferFunctionProperty(transferFunction.get());

osg::ref_ptrosgVolume::CompositeProperty cp = new 
osgVolume::CompositeProperty;
layer-addProperty(cp.get());
cp-addProperty(tfp.get());


   If I don't use TransferFunctionProperty, I guess osg will use default colour 
map.  Then I no need to create another colour map.  Is that correct?

   For example, the size of my volume cube is 100 * 100 * 50.  If I show the 
first layer (100 * 100 * 1), the colour from the back view is more brightness 
than from the front view.  I am not understand why it is related to 
TransferFunctionProperty. The colour brightness is affected by adjusting the 
SampleDensityProperty value.

   I have more question about performance.  If the image is showed the first 
layer, the performance is the same as showing all layers (100 * 100 * 50).  Is 
any possible way to increase the rendering speeding when only first layer is 
shown?  Many thanks.


Regards,
Clement
   





From: osg-users-boun...@lists.openscenegraph.org 
[osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield 
[robert.osfi...@gmail.com]
Sent: Wednesday, 25 April 2012 2:30 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] osgvolume brightness and sample density

Hi Clement,

You simply need to attach a TransferFunctionProperty to the Layer
assigned VolumeTile and set up this to map floating point intensity
value to the colour/alpha value required. The osgvolume has example of
it's setup.

Robert.

On 12 April 2012 03:52,  clement@csiro.au wrote:
 Hi,

  I am using osgVolume to display my CT data.  If I set the value of 
 SampleDensityProperty lower, I can get more details, but the brightness will 
 become darker or dull.  Does any method that allow to use smaller value of 
 SampleDensityProperty and keep image colour brighter.  I tried to use 
 LightingProperty, but I don't know why I got an error to have this property.


 Regards,
 Clement
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] osgvolume brightness and sample density

2012-05-04 Thread Clement.Chu
Hi Robert,

   Thanks again for your reply.  I am a bit confused on using color map.  I 
would like my program to support at least 8 bit color, so how should I create 
the color map?  Where can I find more information?  osgvolume.cpp does not have 
much details related to color map.  

   All layers are undersampled.  I think I need to adjust the sample density if 
only first layer display.


Regards,
Clement



From: osg-users-boun...@lists.openscenegraph.org 
[osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield 
[robert.osfi...@gmail.com]
Sent: Friday, 4 May 2012 7:09 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] osgvolume brightness and sample density

Hi Clement,

On 4 May 2012 08:46,  clement@csiro.au wrote:
 Hi Robert,

Sorry, I just saw your reply.  Is TransferFunctionProperty used for 
 defined colour map?

osg::ref_ptrosg::TransferFunction1D transferFunction = new 
 osg::TransferFunction1D;
transferFunction-setColor(0.0, osg::Vec4(1.0,0.0,0.0,0.0));
transferFunction-setColor(0.5, osg::Vec4(1.0,1.0,0.0,0.5));
transferFunction-setColor(1.0, osg::Vec4(0.0,0.0,1.0,1.0));

transferFunction-assign(transferFunction-getColorMap());
osg::ref_ptrosgVolume::TransferFunctionProperty tfp = new 
 osgVolume::TransferFunctionProperty(transferFunction.get());

osg::ref_ptrosgVolume::CompositeProperty cp = new 
 osgVolume::CompositeProperty;
layer-addProperty(cp.get());
cp-addProperty(tfp.get());


   If I don't use TransferFunctionProperty, I guess osg will use default 
 colour map.  Then I no need to create another colour map.  Is that correct?

If you don't use a TransferFunctionProperty then the intensity or
colours coming from the Texture3D (sourced from the
osgVolume::ImageLayer) will be used directly, there isn't any default
colour map.


   For example, the size of my volume cube is 100 * 100 * 50.  If I show the 
 first layer (100 * 100 * 1), the colour from the back view is more brightness 
 than from the front view.  I am not understand why it is related to 
 TransferFunctionProperty. The colour brightness is affected by adjusting the 
 SampleDensityProperty value.

If your data is undersampled then it won't be as bright as it would be
if the ray casting take sufficient samples to properly map your
volume.

   I have more question about performance.  If the image is showed the first 
 layer, the performance is the same as showing all layers (100 * 100 * 50).  
 Is any possible way to increase the rendering speeding when only first layer 
 is shown?  Many thanks.

When you say layer, do you simply mean a slice of an 3D osg:Image?  In
osgVolume the Layer class represent as whole 3D image.

Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] osgvolume brightness and sample density

2012-04-11 Thread Clement.Chu
Hi,

  I am using osgVolume to display my CT data.  If I set the value of 
SampleDensityProperty lower, I can get more details, but the brightness will 
become darker or dull.  Does any method that allow to use smaller value of 
SampleDensityProperty and keep image colour brighter.  I tried to use 
LightingProperty, but I don't know why I got an error to have this property.


Regards,
Clement
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Incorrect volume image

2012-03-19 Thread Clement.Chu
Hi Robert,

I appreciated your details explanation.  My program was using coin3D for 
volume rendering previously and it was working fine on Intel graphics machine, 
so I expected osg can work the same.   I absolutely agree with your point of 
view.  I have set the minimum requirement for using osg.  It is worth to 
replace coin3D with OSG for the future use.  Thanks again for your help and 
suggestion.


Regards,
Clement



From: osg-users-boun...@lists.openscenegraph.org 
[osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield 
[robert.osfi...@gmail.com]
Sent: Monday, 19 March 2012 7:54 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Incorrect volume image

Hi Clement,

On 18 March 2012 09:46,  clement@csiro.au wrote:
   Many thanks for your suggestion.  osg is working perfectly on my dell e6410 
 laptop, but others people can't run osg properly on their machines which are 
 standard dell desktop machine with Intel graphics hardware.  I want to 
 overcome this problem on standard dell desktop machines.  Last time you 
 mentioned how to use texture2D, but it seems quite complicated and not using 
 standard osgVolume api.  I would like to know the minimum system requirement 
 for osg especially running osgVolume.  Thanks.

I can specify a minimum requirement for the OSG as it's the minimum
requirements will depend upon each applications needs, so it's really
up to the application developer what limits they choose.  In the case
of osgVolume it requires a least 3D texture support, and preferably
GLSL shader support to go along with it.  Practically this means
OpenGL 2.0 with proper hardware and driver support for 3D textures.
The only hardware and drivers that reliably provide this functionality
are ATI and NVidia GPU and associated drivers.

Intel hardware and drivers so far have shown them selves to be
inappropriate for supporting osgVolume, and I very much doubt this
will change in the mid term.  Perhaps one day Intel will buy out
NVidia and final gets some decent graphics know how, but for now I
think it's a pretty safe bet to assume that all Intel graphics will
not be suitable and would probably be best to be detected at run-time
and an appropriate report provided to your end users.

The 2D texturing fallback you could implement, but it will never be
able to provide the same quality of results and the performance will
be so poor compared to a full osgVolume implementation rendered on
decent hardware I really don't think it would be worth the effort.  As
a point of reference 3 1/2 years ago when I first start work on
osgVolume I looked at the various routes we could take with the
implementation and it was pretty clear that it didn't make much sense
to try and implement a rendering fallback using 2D texturing as the
cost of implementing and maintaining it would be highly
disproportionate to the actual capability achieved.  3 1/2 years it we
already had low cost, low end graphics card capable of doing 3D
textures, it was only the Intel embedded graphics that wouldn't be
able to handle, but they don't have the performance to do it anyway so
it's rather pointless.  Back then anyone who really wants to do volume
rendering would be using a mid to high range card, one wouldn't
convenience of doing high end graphics like volume rendering on
anything less.

Fast forward to today and still doesn't make any sense to adept to
support hardware that doesn't have the feature set or performance to
do volume, and it's so cheap to purchase hardware that can handle it
it really is far far cheaper just to buy someone a new card.  As for
laptops that are stuck with Intel graphics, well sorry, they have
crappy graphics, one shouldn't ever purchase low end graphics for high
end graphics tasks.   Volume rendering *is* high end graphics, it's
one of the few tasks that can push modern graphics cards.

I must admit, I'm kinda surprised that I should have to telling you
this.  You are the first engineer I've come across that has ever
expected volume rendering to work properly on Intel graphics.

Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Incorrect volume image

2012-03-18 Thread Clement.Chu
Hi Robert,

   Many thanks for your suggestion.  osg is working perfectly on my dell e6410 
laptop, but others people can't run osg properly on their machines which are 
standard dell desktop machine with Intel graphics hardware.  I want to overcome 
this problem on standard dell desktop machines.  Last time you mentioned how to 
use texture2D, but it seems quite complicated and not using standard osgVolume 
api.  I would like to know the minimum system requirement for osg especially 
running osgVolume.  Thanks.


Regards,
Clement



From: osg-users-boun...@lists.openscenegraph.org 
[osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield 
[robert.osfi...@gmail.com]
Sent: Saturday, 17 March 2012 3:42 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Incorrect volume image

Hi Clement,

On 16 March 2012 14:38,  clement@csiro.au wrote:
   Last time I got the problem is related to hardware, so texture3D is not 
 supported by the graphic card.  Now I tested on other machines.

It's still crappy Intel graphics graphics.  You absolutely should
expect crappy results with volume on any Intel graphics system.   I
have said this several times now, but it seems the message hasn't sunk
in yet.  So... I'll say it again.  IT'S POINTLESS TRYING TO DO VOLUME
RENDERING ON INTEL GRAPHICS HARDWARE, THEY ARE TOTALLY AND UTTERLY
INCAPABLE OF HANDLING IT.

I ran the testing code and there is no any error message on console, but the 
display image is not correct.  The image problem is same as the image shown on 
 
http://www.openscenegraph.org/projects/osg/wiki/Community/Tasks/OpenGLConformance
 about GL_SGIS_generate_mipmap doesn't work, so I guess the problem is 
related to mipmap.  Do you think this problem is also related to the hardware?

What did I say in my previous email?  1) It has nothing to do with
mipmapping because mipmapping isn't used for volume rendering, 2)
Intel graphics hardware and driver are woefully inadequate.

I know this isn't the message you want to hear, but you'll get the
same message every time you try and attempt to volume rendering with
Intel hardware.  If you can't take this on board or other things I
suggest, then how much point is there in me even trying to reply to
your support posts?

Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Incorrect volume image

2012-03-16 Thread Clement.Chu
Hi Robert,

   Last time I got the problem is related to hardware, so texture3D is not 
supported by the graphic card.  Now I tested on other machines.  I ran the 
testing code and there is no any error message on console, but the display 
image is not correct.  The image problem is same as the image shown on  
http://www.openscenegraph.org/projects/osg/wiki/Community/Tasks/OpenGLConformance
 about GL_SGIS_generate_mipmap doesn't work, so I guess the problem is 
related to mipmap.  Do you think this problem is also related to the hardware?


Regards,
Clement





From: osg-users-boun...@lists.openscenegraph.org 
[osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield 
[robert.osfi...@gmail.com]
Sent: Friday, 16 March 2012 8:17 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Incorrect volume image

Hi Clement,

On 16 March 2012 03:13,  clement@csiro.au wrote:
 When I loaded an image with using osgvolume, it cannot show probably.  I 
 found the error listed as 
 http://www.openscenegraph.org/projects/osg/wiki/Community/Tasks/OpenGLConformance
  about GL_SGIS_generate_mipmap doesn't work.  I would like to know whether 
 there is a any solution to fix the problem.  My graphic card details is as 
 below.  Thanks.

The note on the OpenGLConformance page is for an ATI graphics card,
not Intel GMA graphics.

In general one doesn't use mipmapping with volumes, and osgVolume by
default just uses linear interpolation filters with the Texture3D so
won't be invoking any mipmap generation, either on the CPU side or GPU
side.

I therefore don't think the issue you have is to do with the
GL_SGIS_generate_mipmap. What is the reason why you suggested this?

As I've said before Intel graphics isn't something that is going to
handle volume rendering, it neither has the hardware capability or
driver quality up to the task.  If you want to do volume rendering you
should use an ATI or NVidia graphics card.  Even a $50 card will be
pretty capable, it's certainly far far less work just buy the
appropriate hardware for the task than just and chase up problems with
hardware that will never be capable of doing doing proper volume
rendering.

Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Incorrect volume image

2012-03-15 Thread Clement.Chu
Hi,

 When I loaded an image with using osgvolume, it cannot show probably.  I 
found the error listed as 
http://www.openscenegraph.org/projects/osg/wiki/Community/Tasks/OpenGLConformance
 about GL_SGIS_generate_mipmap doesn't work.  I would like to know whether 
there is a any solution to fix the problem.  My graphic card details is as 
below.  Thanks.


Intel(R) Graphics Media Accelerator Driver Report


Report Date:03/16/2012
Report Time[hr:mm:ss]:  14:10:42
Driver Version: 8.15.10.1855
Operating System:   Windows 7 Enterprise* , Service Pack 1 
(6.1.7601)
Default Language:   English
DirectX* Version:   11.0
Physical Memory:1979 MB
Minimum Graphics Memory:32 MB
Maximum Graphics Memory:765 MB
Graphics Memory in Use: 44 MB
Processor:  x86 family 6 Model 23 Stepping 10
Processor Speed:2992 MHZ
Vendor ID:  8086
Device ID:  2E12
Device Revision:03


*   Accelerator Information   *

Accelerator in Use: Intel(R) 4 Series Internal Chipset
Video BIOS: 1702.2
Current Graphics Mode:  1280 by 1024 True Color (60 Hz)



Regards,
Clement
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] osgVolume RayTracedTechnique problem

2012-03-04 Thread Clement.Chu
Hi Robert,

My program was using coin3D for volume rendering before.  Now it is 
replaced with osg, but I still want the existing machine is able to run osg 
version.  Last time you mentioned it is possible to implement a crude 3D volume 
rendering based on 2D textures.  Can you tell me more in details how to do?  Do 
you mean the current osg doesn't have this feature?  Is it required to modify 
the source code and recompile again?  Thanks.


Regards,
Clement



From: osg-users-boun...@lists.openscenegraph.org 
[osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield 
[robert.osfi...@gmail.com]
Sent: Friday, 2 March 2012 8:24 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] osgVolume RayTracedTechnique problem

Hi Clement,

On 2 March 2012 04:12,  clement@csiro.au wrote:
 The graphic details of this machine is Intel Q35 Express Chipset.  Is 
 osgVolume not support this chipset?

I'm rather surprised that you'd even attempt volume rendering on such
in capble hardware.

Volume rendering is one of most challenging tasks for any graphics
card to handle, it tougher than *any* game available, it pushes the
memory bandwidth and capacity to the limit, it can brings high end
hardware to it knees.  Yet you are trying to get things working on
crappy Intel embedded graphics and virtual machine.

You really need to reset your expectations. Volume rendering requires
decent graphics hardware. Is not the osgVolume doesn't support crappy
graphics, it's that crappy graphics doesn't support volume rendering.

Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] osgVolume RayTracedTechnique problem

2012-03-01 Thread Clement.Chu
Hi Robert,

  There is no any error message popup.  I tested on three machines which are 
running windows xp.  They also have the same problem.  I guess the problem may 
be related to opengl32.dll file which is at c:\windows\system32.  The version 
of this file is 5.1 in Windows XP and 6.1 in windows 7.  I tried to run the 
program with opengl32 5.1 version in Windows 7.  It also comes out the same 
problem (volume filled with white).  If I replaced with the 6.1 version, the 
problem is gone.  But I cannot use the 6.1 opengl32 in windows xp since this 
file is linking to mscvrt.dll file and it cannot be replaced.  My test code is 
very simple. Even the size of voxel is small, the problem is still existed.

int nx = 20;
int ny = 20;
int nz = 10;

   unsigned char *pdisp_ptr;
   pdisp_ptr = (unsigned char*)malloc(nx * ny *nz * 4 *(sizeof(unsigned 
char)));
   
osg::ref_ptrosgVolume::Volume osgVolume = new osgVolume::Volume;
osg::ref_ptrosgVolume::VolumeTile tile = new osgVolume::VolumeTile;
osgVolume-addChild(tile.get());
osg::ref_ptrosg::Image osgImage = new osg::Image;
osg::ref_ptrosgVolume::ImageLayer layer = new 
osgVolume::ImageLayer(osgImage.get());

tile-setLayer(layer.get());
tile-setVolumeTechnique(new osgVolume::RayTracedTechnique());
osgImage-setImage(nx, ny, nz, GL_RGBA8, GL_RGBA, GL_UNSIGNED_BYTE, 
pdisp_ptr, osg::Image::NO_DELETE);

osg::ref_ptrosg::RefMatrix matrix = new osg::RefMatrix;
osg::ref_ptrosgVolume::Locator locator = new 
osgVolume::Locator(*matrix.get());
layer-setLocator(locator.get());
tile-setLocator(locator.get());
locator-setTransformAsExtents(-nx/2.0, -ny/2.0, nx/2.0, ny/2.0, 
-nz/2.0, nz/2.0); 

osg::ref_ptrosgVolume::CompositeProperty cp = new 
osgVolume::CompositeProperty;
layer-addProperty(cp.get());

osg::ref_ptrosgVolume::AlphaFuncProperty ap = new 
osgVolume::AlphaFuncProperty(0.1f);
osg::ref_ptrosgVolume::SampleDensityProperty sdProperty = new 
osgVolume::SampleDensityProperty(0.005);
osg::ref_ptrosgVolume::TransparencyProperty tp = new 
osgVolume::TransparencyProperty(1.0f);

cp-addProperty(ap.get());
cp-addProperty(sdProperty.get());
cp-addProperty(tp.get());

   osgViewer-setSceneData(osgVolume .get());
   osgViewer-realize();


All machines in windows XP can run 3D program such as coin3D. If it is hardware 
or driver problem, they should have the problem to run others 3D program.  Let 
me know if you need any information.  Thanks.


Regards,
Clement



From: osg-users-boun...@lists.openscenegraph.org 
[osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield 
[robert.osfi...@gmail.com]
Sent: Thursday, 1 March 2012 7:59 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] osgVolume RayTracedTechnique problem

Hi Clement,

On 29 February 2012 14:26,  clement@csiro.au wrote:
   My program is set to use RayTracedTechnique for display voxel.  I tested 
 the same program on windows XP and windows 7 machines.  Only windows 7 
 machine can display the image properly.  In windows XP, it shows the cube 
 filled with white colour.  I found out the problem is related to 
 RayTracedTechnique.  Any one got similar problem?  How to fix this?  Many 
 thanks.

This is most likely to be an error in the OpenGL driver, unless your
hardware is dramatically different and can't handle the shaders.

As how to fix it... well you don't provide any information about any
OpenGL errors being reported, what hardware you are using, what size
of volume - you say voxel which is means one single data value which
can't be right...

Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] osgVolume RayTracedTechnique problem

2012-03-01 Thread Clement.Chu
Hi Robert,  


  If I set to use RayTracedTechnique, the output message shows below:

Windows Error #127: [Screen #0] ChooseMatchingPixelFormat() - 
wglChoosePixelFormatARB extension not found, trying GDI. R
eason: The specified procedure could not be found.

Rendering in software: pixelFormatIndex 3
Locator::computeLocalBounds
Warning: Texture3D::apply(..) failed, 3D texturing is not support by OpenGL 
driver.
Warning: Texture3D::apply(..) failed, 3D texturing is not support by OpenGL 
driver.
Warning: detected OpenGL error 'invalid enumerant' at after RenderBin::draw(..)
Warning: Texture3D::apply(..) failed, 3D texturing is not support by OpenGL 
driver.
Warning: Texture3D::apply(..) failed, 3D texturing is not support by OpenGL 
driver.
Warning: detected OpenGL error 'invalid enumerant' at after RenderBin::draw(..)
Warning: Texture3D::apply(..) failed, 3D texturing is not support by OpenGL 
driver.
Warning: Texture3D::apply(..) failed, 3D texturing is not support by OpenGL 
driver.


  If I set to use FixedFunctionTechnique, the output message shows below:

Matrix = {
350 0 0 0
0 350 0 0
0 0 60 0
-175 -175 -30 1
}

Windows Error #127: [Screen #0] ChooseMatchingPixelFormat() - 
wglChoosePixelFormatARB extension not found, trying GDI. R
eason: The specified procedure could not be found.

Rendering in software: pixelFormatIndex 3
Locator::computeLocalBounds
Warning: Texture3D::apply(..) failed, 3D texturing is not support by OpenGL 
driver.
Warning: Texture3D::apply(..) failed, 3D texturing is not support by OpenGL 
driver.
Warning: detected OpenGL error 'invalid enumerant' at after RenderBin::draw(..)
Warning: Texture3D::apply(..) failed, 3D texturing is not support by OpenGL 
driver.
Warning: Texture3D::apply(..) failed, 3D texturing is not support by OpenGL 
driver.
Warning: detected OpenGL error 'invalid enumerant' at after RenderBin::draw(..)
Warning: Texture3D::apply(..) failed, 3D texturing is not support by OpenGL 
driver.
Warning: Texture3D::apply(..) failed, 3D texturing is not support by OpenGL 
driver.


  Is it my hardware problem?  It cannot support texturing?


Regards,
Clement



From: osg-users-boun...@lists.openscenegraph.org 
[osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield 
[robert.osfi...@gmail.com]
Sent: Thursday, 1 March 2012 9:30 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] osgVolume RayTracedTechnique problem

Hi Clement,

Check the console output from the OSG for errors, the OSG itself
doesn't create pop up for error reporting as it's a scene graph not a
user interface tool.

As for other OpenGL applications not having problems on the system, as
they may well not be using 3D texture and shaders it's pretty likely
that they don't test the OpenGL driver and hardware anywhere close to
what the osgVolume will be doing so is of little relevance.  If you
want to avoid using shaders try the FixedFunctionTechnique instead of
RayTracedTechnique.

Robert.

On 1 March 2012 09:44,  clement@csiro.au wrote:
 Hi Robert,

  There is no any error message popup.  I tested on three machines which are 
 running windows xp.  They also have the same problem.  I guess the problem 
 may be related to opengl32.dll file which is at c:\windows\system32.  The 
 version of this file is 5.1 in Windows XP and 6.1 in windows 7.  I tried to 
 run the program with opengl32 5.1 version in Windows 7.  It also comes out 
 the same problem (volume filled with white).  If I replaced with the 6.1 
 version, the problem is gone.  But I cannot use the 6.1 opengl32 in windows 
 xp since this file is linking to mscvrt.dll file and it cannot be replaced.  
 My test code is very simple. Even the size of voxel is small, the problem is 
 still existed.

int nx = 20;
int ny = 20;
int nz = 10;

   unsigned char *pdisp_ptr;
   pdisp_ptr = (unsigned char*)malloc(nx * ny *nz * 4 *(sizeof(unsigned 
 char)));

osg::ref_ptrosgVolume::Volume osgVolume = new osgVolume::Volume;
osg::ref_ptrosgVolume::VolumeTile tile = new osgVolume::VolumeTile;
osgVolume-addChild(tile.get());
osg::ref_ptrosg::Image osgImage = new osg::Image;
osg::ref_ptrosgVolume::ImageLayer layer = new 
 osgVolume::ImageLayer(osgImage.get());

tile-setLayer(layer.get());
tile-setVolumeTechnique(new osgVolume::RayTracedTechnique());
osgImage-setImage(nx, ny, nz, GL_RGBA8, GL_RGBA, GL_UNSIGNED_BYTE, 
 pdisp_ptr, osg::Image::NO_DELETE);

osg::ref_ptrosg::RefMatrix matrix = new osg::RefMatrix;
osg::ref_ptrosgVolume::Locator locator = new 
 osgVolume::Locator(*matrix.get());
layer-setLocator(locator.get());
tile-setLocator(locator.get());
locator-setTransformAsExtents(-nx/2.0, -ny/2.0, nx/2.0, ny/2.0, 
 -nz/2.0, nz/2.0);

osg::ref_ptrosgVolume::CompositeProperty cp = new 
 osgVolume::CompositeProperty;

Re: [osg-users] osgVolume RayTracedTechnique problem

2012-03-01 Thread Clement.Chu
Hi Robert,

   I think all my windows xp machines cannot support 3D texture.  Is possible 
to force osg to use 2D texture on osgVolume?  Thanks.


Regards,
Clement

From: osg-users-boun...@lists.openscenegraph.org 
[osg-users-boun...@lists.openscenegraph.org] On Behalf Of clement@csiro.au 
[clement@csiro.au]
Sent: Thursday, 1 March 2012 11:32 PM
To: osg-users@lists.openscenegraph.org
Subject: [ExternalEmail] Re: [osg-users] osgVolume RayTracedTechnique problem

Hi Robert,


  If I set to use RayTracedTechnique, the output message shows below:

Windows Error #127: [Screen #0] ChooseMatchingPixelFormat() - 
wglChoosePixelFormatARB extension not found, trying GDI. R
eason: The specified procedure could not be found.

Rendering in software: pixelFormatIndex 3
Locator::computeLocalBounds
Warning: Texture3D::apply(..) failed, 3D texturing is not support by OpenGL 
driver.
Warning: Texture3D::apply(..) failed, 3D texturing is not support by OpenGL 
driver.
Warning: detected OpenGL error 'invalid enumerant' at after RenderBin::draw(..)
Warning: Texture3D::apply(..) failed, 3D texturing is not support by OpenGL 
driver.
Warning: Texture3D::apply(..) failed, 3D texturing is not support by OpenGL 
driver.
Warning: detected OpenGL error 'invalid enumerant' at after RenderBin::draw(..)
Warning: Texture3D::apply(..) failed, 3D texturing is not support by OpenGL 
driver.
Warning: Texture3D::apply(..) failed, 3D texturing is not support by OpenGL 
driver.


  If I set to use FixedFunctionTechnique, the output message shows below:

Matrix = {
350 0 0 0
0 350 0 0
0 0 60 0
-175 -175 -30 1
}

Windows Error #127: [Screen #0] ChooseMatchingPixelFormat() - 
wglChoosePixelFormatARB extension not found, trying GDI. R
eason: The specified procedure could not be found.

Rendering in software: pixelFormatIndex 3
Locator::computeLocalBounds
Warning: Texture3D::apply(..) failed, 3D texturing is not support by OpenGL 
driver.
Warning: Texture3D::apply(..) failed, 3D texturing is not support by OpenGL 
driver.
Warning: detected OpenGL error 'invalid enumerant' at after RenderBin::draw(..)
Warning: Texture3D::apply(..) failed, 3D texturing is not support by OpenGL 
driver.
Warning: Texture3D::apply(..) failed, 3D texturing is not support by OpenGL 
driver.
Warning: detected OpenGL error 'invalid enumerant' at after RenderBin::draw(..)
Warning: Texture3D::apply(..) failed, 3D texturing is not support by OpenGL 
driver.
Warning: Texture3D::apply(..) failed, 3D texturing is not support by OpenGL 
driver.


  Is it my hardware problem?  It cannot support texturing?


Regards,
Clement



From: osg-users-boun...@lists.openscenegraph.org 
[osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield 
[robert.osfi...@gmail.com]
Sent: Thursday, 1 March 2012 9:30 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] osgVolume RayTracedTechnique problem

Hi Clement,

Check the console output from the OSG for errors, the OSG itself
doesn't create pop up for error reporting as it's a scene graph not a
user interface tool.

As for other OpenGL applications not having problems on the system, as
they may well not be using 3D texture and shaders it's pretty likely
that they don't test the OpenGL driver and hardware anywhere close to
what the osgVolume will be doing so is of little relevance.  If you
want to avoid using shaders try the FixedFunctionTechnique instead of
RayTracedTechnique.

Robert.

On 1 March 2012 09:44,  clement@csiro.au wrote:
 Hi Robert,

  There is no any error message popup.  I tested on three machines which are 
 running windows xp.  They also have the same problem.  I guess the problem 
 may be related to opengl32.dll file which is at c:\windows\system32.  The 
 version of this file is 5.1 in Windows XP and 6.1 in windows 7.  I tried to 
 run the program with opengl32 5.1 version in Windows 7.  It also comes out 
 the same problem (volume filled with white).  If I replaced with the 6.1 
 version, the problem is gone.  But I cannot use the 6.1 opengl32 in windows 
 xp since this file is linking to mscvrt.dll file and it cannot be replaced.  
 My test code is very simple. Even the size of voxel is small, the problem is 
 still existed.

int nx = 20;
int ny = 20;
int nz = 10;

   unsigned char *pdisp_ptr;
   pdisp_ptr = (unsigned char*)malloc(nx * ny *nz * 4 *(sizeof(unsigned 
 char)));

osg::ref_ptrosgVolume::Volume osgVolume = new osgVolume::Volume;
osg::ref_ptrosgVolume::VolumeTile tile = new osgVolume::VolumeTile;
osgVolume-addChild(tile.get());
osg::ref_ptrosg::Image osgImage = new osg::Image;
osg::ref_ptrosgVolume::ImageLayer layer = new 
 osgVolume::ImageLayer(osgImage.get());

tile-setLayer(layer.get());
tile-setVolumeTechnique(new osgVolume::RayTracedTechnique());
osgImage-setImage(nx, ny, nz, 

Re: [osg-users] osgVolume RayTracedTechnique problem

2012-03-01 Thread Clement.Chu
Hi Robert,

   One of the machines is using Intel E8300 Du e core 2.83 cpu with using on 
board graphic.  Another XP machine I created by virtual machine.  I am not sure 
the spec of last machine and I will confirm later.


Regards,
Clement



From: osg-users-boun...@lists.openscenegraph.org 
[osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield 
[robert.osfi...@gmail.com]
Sent: Friday, 2 March 2012 2:02 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] osgVolume RayTracedTechnique problem

Hi Clement,

On 1 March 2012 12:47,  clement@csiro.au wrote:
   I think all my windows xp machines cannot support 3D texture.  Is possible 
 to force osg to use 2D texture on osgVolume?  Thanks.

osgVolume is designed around 3D texturing, both the fixed function and
shader techniques use 3D textures.  It would be possible to implement
a crude 3D volume rendering based on 2D textures but it would be very
limited in what it could do.

3D texturing has been a standard feature for graphics cards for quite
a few years now so if one is doing volume rendering it's normally a
reasonable requirement to have the hardware that is capable of
handling the task.  It also begs the question about just what hardware
is in those WindowsXP machines, I asked this earlier but you haven't
yet mentioned.  Could it be some old intel hardware?

Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] osgVolume RayTracedTechnique problem

2012-03-01 Thread Clement.Chu
Hi Robert, 

  I have updated the driver on one of machines.  The 3D texture message is 
gone, but I got other message.

Warning: Could not find plugin to read objects from file shaders/volume.vert.
Warning: Could not find plugin to read objects from file shaders/volume.frag.
Locator::computeLocalBounds
Scaling image from (350,350) to (128,128)
Error Image::scaleImage() do not succeed : scaling of volumes not implemented.
Scaling image from (350,350) to (128,128)
Error Image::scaleImage() do not succeed : scaling of volumes not implemented.

  Any idea what is it?  Thank you for your help again.


Regards,
Clement



From: osg-users-boun...@lists.openscenegraph.org 
[osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield 
[robert.osfi...@gmail.com]
Sent: Friday, 2 March 2012 2:02 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] osgVolume RayTracedTechnique problem

Hi Clement,

On 1 March 2012 12:47,  clement@csiro.au wrote:
   I think all my windows xp machines cannot support 3D texture.  Is possible 
 to force osg to use 2D texture on osgVolume?  Thanks.

osgVolume is designed around 3D texturing, both the fixed function and
shader techniques use 3D textures.  It would be possible to implement
a crude 3D volume rendering based on 2D textures but it would be very
limited in what it could do.

3D texturing has been a standard feature for graphics cards for quite
a few years now so if one is doing volume rendering it's normally a
reasonable requirement to have the hardware that is capable of
handling the task.  It also begs the question about just what hardware
is in those WindowsXP machines, I asked this earlier but you haven't
yet mentioned.  Could it be some old intel hardware?

Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] osgVolume RayTracedTechnique problem

2012-03-01 Thread Clement.Chu
The graphic details of this machine is Intel Q35 Express Chipset.  Is osgVolume 
not support this chipset?


Regards,
Clement



From: osg-users-boun...@lists.openscenegraph.org 
[osg-users-boun...@lists.openscenegraph.org] On Behalf Of clement@csiro.au 
[clement@csiro.au]
Sent: Friday, 2 March 2012 11:47 AM
To: osg-users@lists.openscenegraph.org
Subject: [ExternalEmail] Re: [osg-users] osgVolume RayTracedTechnique problem

Hi Robert,

  I have updated the driver on one of machines.  The 3D texture message is 
gone, but I got other message.

Warning: Could not find plugin to read objects from file shaders/volume.vert.
Warning: Could not find plugin to read objects from file shaders/volume.frag.
Locator::computeLocalBounds
Scaling image from (350,350) to (128,128)
Error Image::scaleImage() do not succeed : scaling of volumes not implemented.
Scaling image from (350,350) to (128,128)
Error Image::scaleImage() do not succeed : scaling of volumes not implemented.

  Any idea what is it?  Thank you for your help again.


Regards,
Clement



From: osg-users-boun...@lists.openscenegraph.org 
[osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield 
[robert.osfi...@gmail.com]
Sent: Friday, 2 March 2012 2:02 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] osgVolume RayTracedTechnique problem

Hi Clement,

On 1 March 2012 12:47,  clement@csiro.au wrote:
   I think all my windows xp machines cannot support 3D texture.  Is possible 
 to force osg to use 2D texture on osgVolume?  Thanks.

osgVolume is designed around 3D texturing, both the fixed function and
shader techniques use 3D textures.  It would be possible to implement
a crude 3D volume rendering based on 2D textures but it would be very
limited in what it could do.

3D texturing has been a standard feature for graphics cards for quite
a few years now so if one is doing volume rendering it's normally a
reasonable requirement to have the hardware that is capable of
handling the task.  It also begs the question about just what hardware
is in those WindowsXP machines, I asked this earlier but you haven't
yet mentioned.  Could it be some old intel hardware?

Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] osgVolume RayTracedTechnique problem

2012-02-29 Thread Clement.Chu
Hi,

   My program is set to use RayTracedTechnique for display voxel.  I tested the 
same program on windows XP and windows 7 machines.  Only windows 7 machine can 
display the image properly.  In windows XP, it shows the cube filled with white 
colour.  I found out the problem is related to RayTracedTechnique.  Any one got 
similar problem?  How to fix this?  Many thanks.


Regards,
Clement
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] How to detect rotating image

2012-02-27 Thread Clement.Chu
Hi Robert,

  Thanks for your suggestion.  I checked the source code viewerbase.cpp.  There 
is attribute called _runFrameScheme, but the value is assigned by 
getenv(OSG_RUN_FRAME_SCHEME).  Except to set the environment variable, any 
method I can assign the value to _runFrameScheme?  Thanks.


Regards,
Clement

From: osg-users-boun...@lists.openscenegraph.org 
[osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield 
[robert.osfi...@gmail.com]
Sent: Monday, 27 February 2012 9:55 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] How to detect rotating image

Hi Clement,

The osgViewer::ViewerBase (base class for Viewer) has a FrameScheme
hint for the run() method which enables ON_DEMAND or CONTINUOUS,
ON_DEMAND is the approach you'd want.  You'll be calling frame()
yourself rather than run() so won't be able to utilize this feature,
but you should be able to learn from it.  Have a look at the
ViewerBase::run() method in
OpenSceneGraph/src/osgViewer/ViewerBase.cpp, in particular the use of
checkNeedToDoFrame() which is used to decide whether a frame is needed
or not.

Robert.

On 27 February 2012 09:57,  clement@csiro.au wrote:
 Hi Robert,

I mentioned before I got much cpu usage on MFC window.  In osgMFC example, 
 it uses a thread and for loop to keep calling _osgViewer-frame().  It is a 
 reason why the cpu keeps loading and it also depended on how large of volume 
 data loaded.  Now I have changed to call frame() on MFC OnPaint event. It can 
 decrease much cpu usage.  I also added to call frame() on mouse move, mouse 
 wheel and size events for zooming and rotating the image.  But all MFC events 
 cannot be fired if the image is rotating by itself.  Thus, I am thinking 
 whether osg has an event to detect the image is rotating.

  I just found a solution to add MFC mouse button up and down to detect 
 whether the user wants to rotate the image.  Then I can do it all on MFC 
 event.


 Regards,
 Clement
 
 From: osg-users-boun...@lists.openscenegraph.org 
 [osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield 
 [robert.osfi...@gmail.com]
 Sent: Monday, 27 February 2012 8:17 PM
 To: OpenSceneGraph Users
 Subject: Re: [osg-users] How to detect rotating image

 Hi Clement,

 On 27 February 2012 06:26,  clement@csiro.au wrote:
   I would like to know how to detect the image is rotating.  For example, we 
 can use the mouse to rotate the image on viewer.  If we drag on the viewer, 
 the image will automatically rotate.  Any event I can get the image is 
 rotating by itself?  Thanks.

 It's not possible to know precisely what you mean given the above.
 What exactly do you mean by image?  A texture on a quad?  The whole
 framebuffer? Are we talking about an object in the scene graph being
 rotated by a transform, or simply an object moving because the camera
 is moving.

 Robert.
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] How to detect rotating image

2012-02-27 Thread Clement.Chu
Hi Robert,

   Sorry for the mass email.  I have debugged the program and I am sure 
ON_DEMAND is set to OSG_RUN_FRAME_SCHEME, but I can't see any different.  The 
cpu usage is still used 25% on idle.


Regards,
Clement


From: osg-users-boun...@lists.openscenegraph.org 
[osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield 
[robert.osfi...@gmail.com]
Sent: Tuesday, 28 February 2012 12:41 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] How to detect rotating image

Hi Clement,

If you want to find out what is going on use a debugger.  A modicum of
self reliance is key element of being a successful programmer.  You
can't expect others to keep hand walking your through every little
feature one by one.

Robert.

On 27 February 2012 13:11,  clement@csiro.au wrote:
 Hi Robert,

  Do you know how to test the osgViewer is using ON_DEMAND flag?  Here is my 
 code:

 void cOSG::Render(void* ptr)
 {
cOSG* osg = (cOSG*)ptr;
osgViewer::Viewer* viewer = osg-getViewer();
viewer-run();
 }

 void cOSG::initOSGViewer()
 {
putenv(OSG_RUN_FRAME_SCHEME=ON_DEMAND);
osgViewer::Viewer* osgViewer = new osgViewer::Viewer();
...
...
 }


   Before I create osgViewer, I added environment variable.  But I can't see 
 any different compare without environment variable setting.  I am not sure 
 whether osg viewer is using ON_DEMAND.


 Regards,
 Clement


 
 From: osg-users-boun...@lists.openscenegraph.org 
 [osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield 
 [robert.osfi...@gmail.com]
 Sent: Monday, 27 February 2012 10:35 PM
 To: OpenSceneGraph Users
 Subject: Re: [osg-users] How to detect rotating image

 On 27 February 2012 11:26,  clement@csiro.au wrote:
 Hi Robert,

  Thanks for your suggestion.  I checked the source code viewerbase.cpp.  
 There is attribute called _runFrameScheme, but the value is assigned by 
 getenv(OSG_RUN_FRAME_SCHEME).  Except to set the environment variable, any 
 method I can assign the value to _runFrameScheme?  Thanks.

 You have the source code, your hopefully are a programmer so should be
 capable of looking at the API and reading what the methods are.
 Please try it before asking lots of low level questions that could be
 answered with a quick look with an editor.

 Robert.
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] How to detect rotating image

2012-02-26 Thread Clement.Chu
Hi,

   I would like to know how to detect the image is rotating.  For example, we 
can use the mouse to rotate the image on viewer.  If we drag on the viewer, the 
image will automatically rotate.  Any event I can get the image is rotating by 
itself?  Thanks.


Regards,
Clement
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] osgvolume performance

2012-02-19 Thread Clement.Chu
Hi Robert,

   Thank you for your solution.  Using SampleDensityWhenMovingProperty can 
reduce the density on moving.  Mouse becomes responsive on moving now.  On the 
cpu usage, I notice it always stays on 15-20%.   I am using MFC.  When I 
clicked on menu bar and select menu, it is obviously delay.  I guess the 
problem is occurred as the following code.  I am using another thread to run 
the code below.

while (!viewer-done()) {
viewer-run();
}

If I opened more than one sample at the same time, cpu usage will increase to 
20-30%.  The whole program will be very slow.  Anyway to avoid too much cpu 
loading.  Thanks.


Regards,
Clement



From: osg-users-boun...@lists.openscenegraph.org 
[osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield 
[robert.osfi...@gmail.com]
Sent: Friday, 17 February 2012 10:59 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] osgvolume performance

Hi Clement,

On 17 February 2012 01:53,  clement@csiro.au wrote:
   I am using MFC to display osg volume data.  If the sample data is 30 * 30 * 
 20 voxel, it is quite smooth on rotating the image on viewer.  If the sample 
 data is 350 * 350 * 60 voxel, I can't rotate the image as smooth as before.  
 If I used higher voxel data, the rotation become very hard.  I would like to 
 know if there is any way to improve the performance.  Thanks.

With higher res data you have to take more samples to accurately
represent the data so it takes much more work on the GPU to do it -
volume rendering is the most intensive type of rendering that graphics
card do so I'm afraid low framerate is the norm.  osgVolume allows you
to alter the sample density so you can trade visual quality for speed
via the SampleDensityProperty.  Press 'd' and move the mouse up and
down to alter the sample density.  You can also use a
SampleDensityWhenMovingProperty to tell osgVolume to use a different
sample density when moving.

Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] osgvolume performance

2012-02-16 Thread Clement.Chu
Hi,

   I am using MFC to display osg volume data.  If the sample data is 30 * 30 * 
20 voxel, it is quite smooth on rotating the image on viewer.  If the sample 
data is 350 * 350 * 60 voxel, I can't rotate the image as smooth as before.  If 
I used higher voxel data, the rotation become very hard.  I would like to know 
if there is any way to improve the performance.  Thanks.


Regards,
Clement
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] OSG runtime error on Visual Studio Debug mode

2012-02-15 Thread Clement.Chu
Hi,

   I am using osg version 3.0.1 with MS Visual Studio 2008.  My application is 
embedded osg viewer to display sample, so it is not necessary to build my 
application with using debug version of osg.  The application build settings is 
using all non-debug osg libraries even on Debug or Release configuration .  
I can successfully build the application without any error.  If I am using 
Release configuration to build, then run the application and there is no any 
error showed.  While I am using Debug configuration to build, I got unhandled 
exception error on runtime.  Anyone knows how I can avoid this error. Seems 
Debug configuration settings must be used osg debug libraries, but I am not 
debug the osg.  Anyone can help?  Thanks.


Regards,
Clement
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] osgvolume opacity settings

2012-02-15 Thread Clement.Chu
Hi Robert,

  I think my problem is related to AlphaFuncProperty and SampleDensityProperty 
settings.  From your previously explanation for the function AlphaFuncProperty 
, TransparencyProperty and SampleDensityProperty.

- AlphaFuncProperty is equivalent to glAlphaFunc and sets the alpha value below 
which fragments will be discarded

- TransparencyProperty is an alpha value multiplier that you can use to make 
your volume more transparent.

- SampleDensityProperty controls the size of the step during the ray tracing 
through the volume, the lower the value the more samples, the higher the value 
the less the samples.  If you use a value of 0.5 you'll only get 3 samples 
which clearly won't be enough!


  After I set the value of AlphaFuncProperty to zero, the result is much 
better.  Regarding to your explanation of SampleDensityProperty.  You said a 
value of 0.5 if 3 samples are used.  Is 0.5 for 2 samples?  Would you give me 
some examples for using SampleDensityProperty.  Thank you very much.


Regards,
Clement



From: osg-users-boun...@lists.openscenegraph.org 
[osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield 
[robert.osfi...@gmail.com]
Sent: Tuesday, 14 February 2012 11:41 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] osgvolume opacity settings

Hi Clement,

It could be a driver issue.  It could be something else going.  I
really can't tell.  I know way too little about the specifics of your
setup. Hows about posting your data somewhere so that others can look
at it.  Also do the problems exist with osgvolume?

Robert.

On 14 February 2012 03:10,  clement@csiro.au wrote:
 Hi Robert,

  What kind of information I need to send to you?  I am wondering why the 
 image is changed during rotation.  The inner green rectangle image should be 
 solid, but it only displayed the bottom surface on some angles. This is my 
 settings for volume property.  See if the code below can help.  Thanks again.

osg::ref_ptrosgVolume::AlphaFuncProperty ap = new 
 osgVolume::AlphaFuncProperty(0.1f); // 0.1
osg::ref_ptrosgVolume::SampleDensityProperty sd = new 
 osgVolume::SampleDensityProperty(0.005f); // 0.005
osg::ref_ptrosgVolume::TransparencyProperty tp = new 
 osgVolume::TransparencyProperty(1.0f); // 1.0

osg::ref_ptrosgVolume::CompositeProperty cp = new 
 osgVolume::CompositeProperty;
cp-addProperty(ap.get());
cp-addProperty(sd.get());
cp-addProperty(tp.get());



 Regards,
 Clement


 
 From: osg-users-boun...@lists.openscenegraph.org 
 [osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield 
 [robert.osfi...@gmail.com]
 Sent: Friday, 10 February 2012 10:41 PM
 To: OpenSceneGraph Users
 Subject: Re: [osg-users] osgvolume opacity settings

 Hi Clement,

 The pictures and your description don't provide sufficient information
 to have any idea what might be wrong.

 Robert.

 On 10 February 2012 03:01,  clement@csiro.au wrote:
 Hi Robert,

   I captured two screen shots about the volume data display.  I don't know 
 why in some volume data is disappear in some angles.  The screenshot 
 test1.jpg and test2.jpg contain a green cube.  In test1.jpg, it only shows 
 two walls.  If I rotated to another angle like test2.jpg, all walls showed.  
 Do you know how to fix it?  Many thanks.


 Regards,
 Clement

 
 From: osg-users-boun...@lists.openscenegraph.org 
 [osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield 
 [robert.osfi...@gmail.com]
 Sent: Thursday, 19 January 2012 8:05 PM
 To: OpenSceneGraph Users
 Subject: Re: [osg-users] osgvolume opacity settings

 Hi Clement,

 On 18 January 2012 23:37,  clement@csiro.au wrote:
osgImage-setImage(nx, ny, nz, GL_RGB16F_ARB, GL_RGBA, 
 GL_UNSIGNED_BYTE, (unsigned char*)data, osg::Image::NO_DELETE);


  My question is about the 4th parameter GL_RGB16F_ARB.  It is very 
 difficult to find out how this parameter affect the image.  In this method, 
 I am sure rest of other parameters used correctly, so I would like to know 
 more about this parameter.  Thanks again for your help.

 The fourth parameter is internalTextureformat which is the format that
 the OSG will tell OpenGL to use as it's internal format for the
 texture objects down on the GPU.  The fifth and sixth parameters are
 pixelFormat and dataType of the source image data.  It's kinda odd
 that you'd want to use a different internal format to the source image
 format. Could it be that the later two parameters don't match your
 source data?

 Robert.
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

 ___
 osg-users 

Re: [osg-users] osgvolume opacity settings

2012-02-13 Thread Clement.Chu
Hi Robert,

  What kind of information I need to send to you?  I am wondering why the image 
is changed during rotation.  The inner green rectangle image should be solid, 
but it only displayed the bottom surface on some angles. This is my settings 
for volume property.  See if the code below can help.  Thanks again.

osg::ref_ptrosgVolume::AlphaFuncProperty ap = new 
osgVolume::AlphaFuncProperty(0.1f); // 0.1
osg::ref_ptrosgVolume::SampleDensityProperty sd = new 
osgVolume::SampleDensityProperty(0.005f); // 0.005
osg::ref_ptrosgVolume::TransparencyProperty tp = new 
osgVolume::TransparencyProperty(1.0f); // 1.0

osg::ref_ptrosgVolume::CompositeProperty cp = new 
osgVolume::CompositeProperty;
cp-addProperty(ap.get());
cp-addProperty(sd.get());
cp-addProperty(tp.get());



Regards,
Clement



From: osg-users-boun...@lists.openscenegraph.org 
[osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield 
[robert.osfi...@gmail.com]
Sent: Friday, 10 February 2012 10:41 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] osgvolume opacity settings

Hi Clement,

The pictures and your description don't provide sufficient information
to have any idea what might be wrong.

Robert.

On 10 February 2012 03:01,  clement@csiro.au wrote:
 Hi Robert,

   I captured two screen shots about the volume data display.  I don't know 
 why in some volume data is disappear in some angles.  The screenshot 
 test1.jpg and test2.jpg contain a green cube.  In test1.jpg, it only shows 
 two walls.  If I rotated to another angle like test2.jpg, all walls showed.  
 Do you know how to fix it?  Many thanks.


 Regards,
 Clement

 
 From: osg-users-boun...@lists.openscenegraph.org 
 [osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield 
 [robert.osfi...@gmail.com]
 Sent: Thursday, 19 January 2012 8:05 PM
 To: OpenSceneGraph Users
 Subject: Re: [osg-users] osgvolume opacity settings

 Hi Clement,

 On 18 January 2012 23:37,  clement@csiro.au wrote:
osgImage-setImage(nx, ny, nz, GL_RGB16F_ARB, GL_RGBA, 
 GL_UNSIGNED_BYTE, (unsigned char*)data, osg::Image::NO_DELETE);


  My question is about the 4th parameter GL_RGB16F_ARB.  It is very 
 difficult to find out how this parameter affect the image.  In this method, 
 I am sure rest of other parameters used correctly, so I would like to know 
 more about this parameter.  Thanks again for your help.

 The fourth parameter is internalTextureformat which is the format that
 the OSG will tell OpenGL to use as it's internal format for the
 texture objects down on the GPU.  The fifth and sixth parameters are
 pixelFormat and dataType of the source image data.  It's kinda odd
 that you'd want to use a different internal format to the source image
 format. Could it be that the later two parameters don't match your
 source data?

 Robert.
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] osgvolume opacity settings

2012-01-18 Thread Clement.Chu
HI Robert,

 I replaced the program from coin to osg and I don't know why osg display 
the image from the same volume data is different from coin.  I think the 
problem is on texture format since I changed to use different parameter of 
texture format such as  GL_RGBA, GL_RGB16F_ARB, GL_RGBA8.  The display images 
are different.  When GL_RGB16F_ARB is used, the colour is closer to I expected, 
but I have no idea why the volume body is empty (1st attached file).  When 
GL_RGBA is used, the body of volume is filled, but the colour is not sharp 
enough.  I don't know how to set to use the right texture parameter.  Sorry for 
my worse explanation.  Hope this time better.  Thanks.


Regards,
Clement
   

From: osg-users-boun...@lists.openscenegraph.org 
[osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield 
[robert.osfi...@gmail.com]
Sent: Thursday, 19 January 2012 4:15 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] osgvolume opacity settings

Hi Clement,

I can't work out specifically what you are expecting to happen.  What
coin does is something I have no experience with so can't comment on
how you might try to obtain a similar image.

Robert.

On 18 January 2012 15:14,  clement@csiro.au wrote:
 Hi Robert,

   Thanks for your reply.  I found the problem may relate to the texture 
 format when called setImage.  I attached three images to describe my problem. 
  The image texture_GL_RGBA.jpg is used GL_RGBA for the 4th parameter in 
 setImage.

 eg.  osgImage-setImage(nx, ny, nz, GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE, 
 (uint8*)pdisp), osg::Image::NO_DELETE);


   The image texture_GL_RGB16F_ARB.jpg is used GL_RGB16F_ARB parameter.  The 
 colour of this image is I expected, but the problem is that this image is no 
 body (only surface have colour).  If I used GL_RGBA, it can fill in the whole 
 volume, but the colour is very light and blur.  The last attachment is 
 captured from coin3d library and it is my original render library.  Now I 
 have replaced with osg, so I expect the osg can display the same result as 
 coin3d.

   From the first two images, do you know which texture format parameter I 
 should use?  Thanks.


 Regards,
 Clement

 
 From: osg-users-boun...@lists.openscenegraph.org 
 [osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield 
 [robert.osfi...@gmail.com]
 Sent: Monday, 16 January 2012 8:21 PM
 To: OpenSceneGraph Users
 Subject: Re: [osg-users] osgvolume opacity settings

 Hi Clement,

 On 16 January 2012 06:21,  clement@csiro.au wrote:
   My application is using osgvolume to display CT data.  There is class 
 called CompositeProperty and there are three property classes 
 (AlphaFuncProperty, SampleDensityProperty and TransparencyProperty) as well. 
  I would like to know more details of those classes and how to apply on 
 osgvolume.  I did to follow the example to use those classes, but when I 
 changed the value of SampleDensityProperty from 0.05 to 0.5.  Some CT data 
 are disappear, so I would like to know more how to control property values.  
 Many thanks.

 AlphaFuncProperty is equivalent to glAlphaFunc and sets the alpha
 value below which fragments will be discarded

 TransparencyProperty is an alpha value multiplier that you can use to
 make your volume more transparent.

 SampleDensityProperty controls the size of the step during the ray
 tracing through the volume, the lower the value
 the more samples, the higher the value the less the samples.  If you
 use a value of 0.5 you'll only get 3 samples which clearly won't be
 enough!

 Robert.
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] osgvolume opacity settings

2012-01-18 Thread Clement.Chu
Change my question.  I followed the osgvolume example.  I made a bit different 
to use setImage function.


osg::ref_ptrosgVolume::VolumeTile tile = new 
osgVolume::VolumeTile;
osgVolume-addChild(tile.get());

osg::ref_ptrosg::Image osgImage = new osg::Image;
osg::ref_ptrosgVolume::ImageLayer layer = new 
osgVolume::ImageLayer(osgImage.get());

tile-setLayer(layer.get());
tile-setEventCallback(new 
osgVolume::PropertyAdjustmentCallback());

osg::ref_ptrosgVolume::AlphaFuncProperty ap = new 
osgVolume::AlphaFuncProperty(0.02f);
osg::ref_ptrosgVolume::SampleDensityProperty sd = new 
osgVolume::SampleDensityProperty(0.05f);
osg::ref_ptrosgVolume::TransparencyProperty tp = new 
osgVolume::TransparencyProperty(1.0f);

osg::ref_ptrosgVolume::CompositeProperty cp = new 
osgVolume::CompositeProperty;
cp-addProperty(ap.get());
cp-addProperty(sd.get());
cp-addProperty(tp.get());


layer-addProperty(cp.get());
tile-setVolumeTechnique(new osgVolume::RayTracedTechnique());
tile-setLayer(layer.get());

osgImage-setImage(nx, ny, nz, GL_RGB16F_ARB, GL_RGBA, 
GL_UNSIGNED_BYTE, (unsigned char*)data, osg::Image::NO_DELETE);


  My question is about the 4th parameter GL_RGB16F_ARB.  It is very 
difficult to find out how this parameter affect the image.  In this method, I 
am sure rest of other parameters used correctly, so I would like to know more 
about this parameter.  Thanks again for your help.


Regards,
Clement



From: osg-users-boun...@lists.openscenegraph.org 
[osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield 
[robert.osfi...@gmail.com]
Sent: Thursday, 19 January 2012 9:22 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] osgvolume opacity settings

Hi Clement,

I really don't know what is going on at your end, what you are
expecting, what you've coded, there is no way I can provide any
answers.

Robert.

On 18 January 2012 17:31,  clement@csiro.au wrote:
 HI Robert,

 I replaced the program from coin to osg and I don't know why osg display 
 the image from the same volume data is different from coin.  I think the 
 problem is on texture format since I changed to use different parameter of 
 texture format such as  GL_RGBA, GL_RGB16F_ARB, GL_RGBA8.  The display images 
 are different.  When GL_RGB16F_ARB is used, the colour is closer to I 
 expected, but I have no idea why the volume body is empty (1st attached 
 file).  When GL_RGBA is used, the body of volume is filled, but the colour is 
 not sharp enough.  I don't know how to set to use the right texture 
 parameter.  Sorry for my worse explanation.  Hope this time better.  Thanks.


 Regards,
 Clement

 
 From: osg-users-boun...@lists.openscenegraph.org 
 [osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield 
 [robert.osfi...@gmail.com]
 Sent: Thursday, 19 January 2012 4:15 AM
 To: OpenSceneGraph Users
 Subject: Re: [osg-users] osgvolume opacity settings

 Hi Clement,

 I can't work out specifically what you are expecting to happen.  What
 coin does is something I have no experience with so can't comment on
 how you might try to obtain a similar image.

 Robert.

 On 18 January 2012 15:14,  clement@csiro.au wrote:
 Hi Robert,

   Thanks for your reply.  I found the problem may relate to the texture 
 format when called setImage.  I attached three images to describe my 
 problem.  The image texture_GL_RGBA.jpg is used GL_RGBA for the 4th 
 parameter in setImage.

 eg.  osgImage-setImage(nx, ny, nz, GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE, 
 (uint8*)pdisp), osg::Image::NO_DELETE);


   The image texture_GL_RGB16F_ARB.jpg is used GL_RGB16F_ARB parameter.  The 
 colour of this image is I expected, but the problem is that this image is no 
 body (only surface have colour).  If I used GL_RGBA, it can fill in the 
 whole volume, but the colour is very light and blur.  The last attachment is 
 captured from coin3d library and it is my original render library.  Now I 
 have replaced with osg, so I expect the osg can display the same result as 
 coin3d.

   From the first two images, do you know which texture format parameter I 
 should use?  Thanks.


 Regards,
 Clement

 
 From: osg-users-boun...@lists.openscenegraph.org 
 [osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield 
 [robert.osfi...@gmail.com]
 Sent: Monday, 16 January 2012 8:21 PM
 To: OpenSceneGraph Users
 Subject: Re: [osg-users] osgvolume opacity settings

 Hi Clement,

 On 16 January 2012 06:21,  clement@csiro.au wrote:
   My application is using osgvolume to display CT data.  There is class 
 called CompositeProperty and there are three 

Re: [osg-users] Place axes at corner

2012-01-17 Thread Clement.Chu
Thanks Robert.

  The example is not quite suitable on my case because my application is 
running on MFC window, but I still got some idea from the example to locate the 
axes on corner.  I created a camera for axes geometry and then added as slave 
to view, but the axes cannot be rotated.  Do you know the reason?  I want the 
axes can be rotated when the volume data is rotated, but I would like to keep 
its size.  I mean the size of the axes is not changed when using mouse to zoom 
the volume data.  Is it possible?  And any hence to do it .  Many thanks.


Regards,
Clement

From: osg-users-boun...@lists.openscenegraph.org 
[osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield 
[robert.osfi...@gmail.com]
Sent: Monday, 16 January 2012 8:18 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Place axes at corner

Hi Clement,

On 16 January 2012 06:14,  clement@csiro.au wrote:
   I have created axes to display on viewer, but I have no idea to place it at 
 the bottom corner of the view.  Anyone know how to location the corner of the 
 view?  Many thanks.

Have a look at the osghud example.

Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Place axes at corner

2012-01-15 Thread Clement.Chu
Hi,

   I have created axes to display on viewer, but I have no idea to place it at 
the bottom corner of the view.  Anyone know how to location the corner of the 
view?  Many thanks.


Regards,
Clement
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] osgvolume opacity settings

2012-01-15 Thread Clement.Chu
Hi,

   My application is using osgvolume to display CT data.  There is class called 
CompositeProperty and there are three property classes (AlphaFuncProperty, 
SampleDensityProperty and TransparencyProperty) as well.  I would like to know 
more details of those classes and how to apply on osgvolume.  I did to follow 
the example to use those classes, but when I changed the value of 
SampleDensityProperty from 0.05 to 0.5.  Some CT data are disappear, so I would 
like to know more how to control property values.  Many thanks.


Regards,
Clemnet
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Draw volume border

2011-12-13 Thread Clement.Chu
Hi,

   I am using osgVolume to display an object.  The width, height and depth of 
the volume are given and it is a cube shape.  Anyone knows how to create a 
border for this volume?  Thanks.


Regards,
Clement


___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Draw volume border

2011-12-13 Thread Clement.Chu
Bounding edge around the volume.  hollow cube.


Clement

From: osg-users-boun...@lists.openscenegraph.org 
[osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield 
[robert.osfi...@gmail.com]
Sent: Wednesday, 14 December 2011 3:39 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Draw volume border

Hi Clement,

On 13 December 2011 14:43,  clement@csiro.au wrote:
   I am using osgVolume to display an object.  The width, height and depth of 
 the volume are given and it is a cube shape.  Anyone knows how to create a 
 border for this volume?  Thanks.

What do you mean by a border?

Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] osgDB::writeImageFile return false in release mode only

2011-12-07 Thread Clement.Chu
Hi,

  I got a problem on calling osgDB::writeImageFile function.  If my program 
built in debug mode and using osg debug libraries, this function works 
perfectly.  If the program is built in release mode with using osg release 
libraries, this function will return false.  Anyone got an idea to fix it?  
Thanks.


Regards,
Clement
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] osgDB::writeImageFile return false in release mode only

2011-12-07 Thread Clement.Chu
Hi Chris,

Thanks for your reply.  My project is using MSVS 9.0 and I am sure I have 
added osgDB.lib in property settings for compiling.  The debug and release 
settings are the same except the libraries for debug that are used the 
libraries with d at the end of library file.  If you think the problem is the 
related dll is not loaded in release mode, why it can work in debug mode.  I 
also would like to know how to do to turn up osg debug level.  Thanks.


Regards,
Clement

From: osg-users-boun...@lists.openscenegraph.org 
[osg-users-boun...@lists.openscenegraph.org] On Behalf Of Chris 'Xenon' Hanson 
[xe...@alphapixel.com]
Sent: Thursday, 8 December 2011 3:04 AM
To: osg-users@lists.openscenegraph.org
Subject: Re: [osg-users] osgDB::writeImageFile return false in release mode only

On 12/7/2011 1:34 AM, clement@csiro.au wrote:
 Hi,
   I got a problem on calling osgDB::writeImageFile function.  If my program 
 built in debug mode and using osg debug libraries, this function works 
 perfectly.  If the program is built in release mode with using osg release 
 libraries, this function will return false.  Anyone got an idea to fix it?  
 Thanks.

  Turn up the OSG Debug level. You're probably not loading the release-mode DLL 
for the
image saver.

--
Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com 
http://www.alphapixel.com/
  Digital Imaging. OpenGL. Scene Graphs. GIS. GPS. Training. Consulting. 
Contracting.
There is no Truth. There is only Perception. To Perceive is to Exist. - 
Xen
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Image origin and scale

2011-09-16 Thread Clement.Chu
Hi Robert,


   If I placed all the codes before started to run the viewer, it is no 
problem.  The scale and locator are correct.  In my program, it allows to 
change the dimension of the image.  Then it will render the image again.  
Because the dimension is changed, I used the same code as before to relocate 
and rescale the image.  Unfortunately, it doesn't work this time.  I guess the 
problem may be on how to let osg known the locator and scale is changed.  Any 
idea?


Regards,
Clement



From: osg-users-boun...@lists.openscenegraph.org 
[osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield 
[robert.osfi...@gmail.com]
Sent: Friday, 16 September 2011 5:03 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Image origin and scale

Hi Clement,

The offsetAndScale image is for scaling the RGBA values rather than
it's location is space.  The Locator object is what determines the
position in space.

Robert.

On Fri, Sep 16, 2011 at 6:06 AM,  clement@csiro.au wrote:
 Hi,


   I have a problem to set the origin and the scale of the image.  I am using 
 osgVolume to render an image.  Here is my code:


osg::ref_ptrosg::Image osgImage = new osg::Image;
osgTile = new osgVolume::VolumeTile;
osgTile-setVolumeTechnique(new osgVolume::RayTracedTechnique());

osgLayer= new osgVolume::ImageLayer(osgImage.get());
osgVolume = new osgVolume::Volume;
osgVolume-addChild(osgTile.get());

   /// the size of the image
int nx = 350;
int ny = 350;
int nz = 60;

osg::RefMatrix* matrix = new osg::RefMatrix(nx, 0.0,0.0,0.0,
   
  0.0,ny, 0.0,0.0,
   
  0.0,0.0,nz, 0.0,
   
  0.0,0.0,0.0,1.0);
osgVolume::Locator* locator = new osgVolume::Locator(*matrix);
osgLayer-setLocator(locator);
osgLayer-offsetAndScaleImage(osg::Vec4(-nx/2, -ny/2, -nz/2, 1.0), 
 osg::Vec4(1.0, 1.0, 1.0, 1.0));
osgTile-setLocator(locator);
osgTile-setLayer(osgLayer.get());


 When I exxcute the above code, the image is located at somewhere, I need to 
 use the mouse to zoom out until I saw the image.  Also the rotation point is 
 at image of bottom left.  I would like to set the rotating point at the 
 center of the image and it can show the right scale at startup.  Anyone knows 
 how to do it?  Many thanks.


 Regards,
 Clement
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Image origin and scale

2011-09-15 Thread Clement.Chu
Hi,


   I have a problem to set the origin and the scale of the image.  I am using 
osgVolume to render an image.  Here is my code:


osg::ref_ptrosg::Image osgImage = new osg::Image;
osgTile = new osgVolume::VolumeTile;
osgTile-setVolumeTechnique(new osgVolume::RayTracedTechnique());

osgLayer= new osgVolume::ImageLayer(osgImage.get());
osgVolume = new osgVolume::Volume;
osgVolume-addChild(osgTile.get());

   /// the size of the image
int nx = 350;
int ny = 350;
int nz = 60;

osg::RefMatrix* matrix = new osg::RefMatrix(nx, 0.0,0.0,0.0,

0.0,ny, 0.0,0.0,

0.0,0.0,nz, 0.0,

0.0,0.0,0.0,1.0);
osgVolume::Locator* locator = new osgVolume::Locator(*matrix);
osgLayer-setLocator(locator);
osgLayer-offsetAndScaleImage(osg::Vec4(-nx/2, -ny/2, -nz/2, 1.0), 
osg::Vec4(1.0, 1.0, 1.0, 1.0));
osgTile-setLocator(locator);
osgTile-setLayer(osgLayer.get());


When I exxcute the above code, the image is located at somewhere, I need to use 
the mouse to zoom out until I saw the image.  Also the rotation point is at 
image of bottom left.  I would like to set the rotating point at the center of 
the image and it can show the right scale at startup.  Anyone knows how to do 
it?  Many thanks.


Regards,
Clement
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] osgVolume volume size limitation

2011-09-12 Thread Clement.Chu
Hi,

   I got to display volume data problem on windows MFC before.  I got an useful 
information in this forum and now I have fixed the problem.  When I tried 
different test cases, I found the volume image cannot be shown probably if the 
volume is large such as 1000*1000*20.  It cannot show the whole volume. It 
shows the centre of image only.  I am thinking whether there is a limitation on 
osg::Volume.  


   I created osg image and set into layer.  The problem occurrs if nx, ny and 
nz are very hight.

image-setImage(nx, ny, nz, GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE, pdisp_ptr, 
osg::Image::NO_DELETE); 



Regards,
Clement
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] setImage error

2011-09-01 Thread Clement.Chu
Hi Ulrich,

The code for reading file is my testing data and I copied the data from one 
format to unsigned char format, so the file won't contain more data than I 
expected.  

Thanks for your suggestion.  It works if I increased the size for malloc, 
but I don't understand.  It is very helpful if you can answer the following 
questions:


1.  when i changed to malloc(nx * ny * nz * 8 * (sizeof(unsigned char))), it 
works, but it doesn't work if I changed 8 to 4.  

2.  why I need to assign the memory with data's size * 8.  is it for RBGA each 
2 bit extra data?  

3.  why osg will excess the data I assigned into Image?  I guess osg is just 
reading from the data I assigned only.

4.  what is the different between osg::Image::NO_DELETE, 
osg::Image::USE_NEW_DELETE and osg::Image::USE_MALLOC_FREE?


Many thanks for your help.


Regards,
Clement



From: osg-users-boun...@lists.openscenegraph.org 
[osg-users-boun...@lists.openscenegraph.org] On Behalf Of Ulrich Hertlein 
[u.hertl...@sandbox.de]
Sent: Thursday, 1 September 2011 5:24 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] setImage error

Hi Clement,

On 31/08/11 19:22 , clement@csiro.au wrote:
   Here is my code: (If nx, ny, nz are used a small number such as 50, 50, 20, 
 the error is gone)

   int nx = 350;
   int ny = 350;
   int nz = 60;

 unsigned char pdisp_ptr = (unsigned char*)malloc(nx * ny * nz * 
 (sizeof(unsigned char)));

I assume that's a 'unsigned char* pdisp_ptr'.

   FILE *pf = fopen(data.txt, r);
   unsigned int dt;
   int count = 0;

   while (!feof(pf)) {
   fscanf_s(pf, %X, dt);
   *pdisp_ptr++ = dt;
   count++;
   if (count == nz) {
   count = 0;
   }
   }
   fclose(pf);

First of all, you could easily corrupt memory, if the file contains more data 
than you expect.

image-setImage(nx, ny, nz, 4, GL_RGBA, GL_UNSIGNED_BYTE, pdisp_ptr, 
 osg::Image::NO_DELETE);

The data buffer you've created is not big enough to hold nx*ny*nz samples of 
RGBA data.

Either you're reading more than expected (reading nx*ny*nz*4 into a nx*ny*nz 
buffer) and
corrupt memory or you're telling OSG that it can read nx*ny*nz*4 bytes out of a 
nx*ny*nz
buffer.

Cheers,
/ulrich
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Colour map

2011-08-31 Thread Clement.Chu
Anyone knows how many colour does osg support?  I would like to generate 65536 
colour map by using the code below.  The size of the object colorMap is 65535.  
Is it possible?  I am sure osg can support 8 bit colour, how about 32bit?  
Thanks.

osg::TransferFunction1D::ColorMap colorMap;

double fcr = 255.0;
int ri, gi, bi, ai, cc;
int step = 16;
int rgb_step = fcr /(step-1);
int a_step = (fcr +1) / step;

cc = 0;
colorMap[0] = osg::Vec4(0.0f, 0.0f, 0.0f, 0.0f);
for (int r=0; rstep; r++) {
ri = r*rgb_step;
for (int g=0; gstep; g++) {
gi = g*rgb_step;
for (int b=0; bstep; b++) {
bi = b*rgb_step;
for (int a=1; a=step; a++) {
ai = min(a*a_step, fcr );
cc++;
colorMap[cc] = osg::Vec4(ri/fcr, 
gi/fcr, bi/fcr, ai/fcr);
}
}
}
}
tf-assign(colorMap);


Regards,
Clement
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Colour map

2011-08-31 Thread Clement.Chu
Hi Robert,

  Does osg support 32 bit color and have up to 65536 colours?

  I used TransferFunction1D because I will use the generated index to find out 
the colour later.  Would you give me an example how to simply create osg::image 
and assign to texture1d?  Thanks.


Regards,
Clement


From: osg-users-boun...@lists.openscenegraph.org 
[osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield 
[robert.osfi...@gmail.com]
Sent: Wednesday, 31 August 2011 5:45 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Colour map

Hi Clement,

TransferFunction1D is really meant for making it easy to handle sparse
data when setting up a 1D Texture for use as a colour look up on the
GPU.

For data where you are just encoding the colours directly in packed
form then it would be more appropriate to simply create a osg::Image
and assign this a Texture1D to use a colour look up table.

Robert.

On Wed, Aug 31, 2011 at 8:19 AM,  clement@csiro.au wrote:
 Anyone knows how many colour does osg support?  I would like to generate 
 65536 colour map by using the code below.  The size of the object colorMap is 
 65535.  Is it possible?  I am sure osg can support 8 bit colour, how about 
 32bit?  Thanks.

osg::TransferFunction1D::ColorMap colorMap;

double fcr = 255.0;
int ri, gi, bi, ai, cc;
int step = 16;
int rgb_step = fcr /(step-1);
int a_step = (fcr +1) / step;

cc = 0;
colorMap[0] = osg::Vec4(0.0f, 0.0f, 0.0f, 0.0f);
for (int r=0; rstep; r++) {
ri = r*rgb_step;
for (int g=0; gstep; g++) {
gi = g*rgb_step;
for (int b=0; bstep; b++) {
bi = b*rgb_step;
for (int a=1; a=step; a++) {
ai = min(a*a_step, fcr );
cc++;
colorMap[cc] = osg::Vec4(ri/fcr, 
 gi/fcr, bi/fcr, ai/fcr);
}
}
}
}
tf-assign(colorMap);


 Regards,
 Clement
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] setImage error

2011-08-31 Thread Clement.Chu
Hi,

  I got an error.  Anyone know what is it?


  I am using visual studio.  The program will stop at _callthreadstartex method 
in threadex.c.   


Error track:

'Test.exe': Loaded 'C:\OSG\bin\osgPlugins-3.0.0\osgdb_glsld.dll', Symbols 
loaded.
First-chance exception at 0x77c47124 in Test.exe: 0x8001: Not implemented.
Unhandled exception at 0x77c47124 in Test.exe: 0x8001: Not implemented.


  Here is my code: (If nx, ny, nz are used a small number such as 50, 50, 20, 
the error is gone)


   // read all data into unsigned char;

int nx = 350;
int ny = 350;
int nz = 60;

unsigned char   pdisp_ptr = (unsigned char*)malloc(nx * ny * nz * 
(sizeof(unsigned char)));
FILE *pf = fopen(data.txt, r);
unsigned int dt;
int count = 0;

while (!feof(pf)) {
fscanf_s(pf, %X, dt);
*pdisp_ptr++ = dt;
count++;
if (count == nz) {
count = 0;
}
}
fclose(pf);
   

osg::ref_ptrosg::Image image = new osg::Image;

osg::ref_ptrosgVolume::VolumeTile tile = new osgVolume::VolumeTile;
tile-setVolumeTechnique(new osgVolume::RayTracedTechnique());

osg::ref_ptrosgVolume::ImageLayer layer= new 
osgVolume::ImageLayer(image.get());
layer-rescaleToZeroToOneRange();
osg::ref_ptrosgVolume::Volume volume = new osgVolume::Volume;
volume-addChild(tile.get());

osgVolume::SwitchProperty* sp = new osgVolume::SwitchProperty;
sp-setActiveProperty(0);

osgVolume::AlphaFuncProperty* ap = new 
osgVolume::AlphaFuncProperty(0.1f);
osgVolume::SampleDensityProperty* sd = new 
osgVolume::SampleDensityProperty(0.005);
osgVolume::TransparencyProperty* tp = new 
osgVolume::TransparencyProperty(1.0);

   osgVolume::CompositeProperty* cp = new osgVolume::CompositeProperty;
   cp-addProperty(ap);
   cp-addProperty(sd);
   cp-addProperty(tp);

   sp-addProperty(cp);

   layer-addProperty(sp);
   tile-setLayer(layer.get());

   image-setImage(nx, ny, nz, 4, GL_RGBA, GL_UNSIGNED_BYTE, pdisp_ptr, 
osg::Image::NO_DELETE); 



Regards,
Clement
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] How to update image data

2011-07-21 Thread Clement.Chu
Hi Robert,

  No.  osgvolume cannot work with my data.  I will see the examples you 
mentioned below first.  See if I can find out the problem.


Regards,
Clement



From: osg-users-boun...@lists.openscenegraph.org 
[osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield 
[robert.osfi...@gmail.com]
Sent: Thursday, 21 July 2011 6:42 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] How to update image data

Hi Clement,

On Thu, Jul 21, 2011 at 3:18 AM,  clement@csiro.au wrote:
   I tried some examples (not volume example).  They worked.  I am using 
 windows xp and ms visual studio .net.  Now I am trying to replace old coin3D 
 codes with osg.  So far I found one example related to volume for my 
 reference.  Do you have any good example for my reference?  Thanks.

osgvolume is the main example that illustrates set of osgVolume Nodes.
 The dicom plugin also creates osgVolume elements so you could look at
it's source as well.  The present3D/osgPresentation also has some
volume rendering support so creates osgVolume elements as well.

You didn't mention whether you have got osgvolume to work on your
data, or the hardware you have.  The osgVolume library assumes that
you hardware/drivers support 3D Textures.

Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] How to update image data

2011-07-20 Thread Clement.Chu
No.  I can't get any image on screen.  Evenytime I changed the size of volume 
data, setImage will be called again.   I would like to know why I can't display 
the volume image at first time.  I am using the same concept with vtk and 
coin3D, I don't have any image display problem.  I want to try osg becasue I 
want to compare the performance with other libraries.  I am looking for 
handling 1000 cube voxel data.


Clement

From: osg-users-boun...@lists.openscenegraph.org 
[osg-users-boun...@lists.openscenegraph.org] On Behalf Of J.P. Delport 
[jpdelp...@csir.co.za]
Sent: Wednesday, 20 July 2011 5:34 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] How to update image data

Hi,

On 20/07/2011 02:35, clement@csiro.au wrote:
 Hi,

 I used the following codes to create Volume data display.

  osg::ref_ptrosg::Image  osgImage = new osg::Image;
  osg::ref_ptrosgVolume::Volume  osgVolume = new osgVolume::Volume;
  osg::ref_ptrosgVolume::VolumeTile  osgTile = new osgVolume::VolumeTile;

  osg::ref_ptrosgVolume::ImageLayer   osgLayer = new 
 osgVolume::ImageLayer(osgImage.get());
  osgTile-setLayer(osgLayer.get());
  osgVolume-addChild(osgTile.get());

  osgVolume::AlphaFuncProperty* ap = new 
 osgVolume::AlphaFuncProperty(0.02f);
  osgVolume::SampleDensityProperty* sd = new 
 osgVolume::SampleDensityProperty(0.005);
  osgVolume::TransparencyProperty* tp = new 
 osgVolume::TransparencyProperty(1.0);
  osgVolume::TransferFunctionProperty* tfp = new 
 osgVolume::TransferFunctionProperty(osgTransFunc.get());

  osgVolume::CompositeProperty* cp = new osgVolume::CompositeProperty;
  cp-addProperty(ap);
  cp-addProperty(sd);
  cp-addProperty(tp);
  cp-addProperty(tfp);

  osgLayer-addProperty(cp);
  osgTile-setVolumeTechnique(new osgVolume::RayTracedTechnique);

 The above codes are used on initializing.  I created the image pointer 
 and assigned to image layer.  Then I will use setImage method to assign I 
 defined the data pointer.
hmm, I'm not familiar with the volume code at all, but I would have
though a layer is a texture without depth (nz==1)?


 osgImage-setImage(nx, ny, nz, 4, GL_RGBA, GL_UNSIGNED_BYTE, pdisp_ptr, 
 osg::Image::NO_DELETE, 1);
 //  where nx, ny, nz are size of data (width, height, depth);
 //  where pdisp_ptr is assigned for using defined data
You can change the magic 4 to also GL_RGBA, but it looks OK to me.

You still have not said whether you get any image at all, even on the
first frame?


 //Then  I also used the following codes to set the size of volume data.  
 I wonder whether I need the following codes if I already the size into image 
 pointer.
 osg::ref_ptrosg::RefMatrix  matrix = new osg::RefMatrix(nx, 0.0,   0.0, 
   0.0,
   
 0.0,   ny, 0.0,   0.0,
   
 0.0,   0.0,   nx, 0.0,
   
 0.0,   0.0,   0.0,   1.0);

 osgLayer-setLocator(new osgVolume::Locator(*matrix));
 osgTile-setLocator(new osgVolume::Locator(*matrix));


 Then I will try to assign the data value to pdisp_ptr.  After that, I 
 will call osgImage-dirty().   But there is no changed on viewer.  Any idea?  
 This is my  first time to use osg on my application, so I am not sure whether 
 my code is crroect.
No change? Was there something at all? How do you assign data to
pdisp_ptr? You must change the data pointed to by pdisp_ptr or call
setImage again if your data is now somewhere else.

jp




 Clement



 
 From: osg-users-boun...@lists.openscenegraph.org 
 [osg-users-boun...@lists.openscenegraph.org] On Behalf Of J.P. Delport 
 [jpdelp...@csir.co.za]
 Sent: Wednesday, 20 July 2011 1:00 AM
 To: OpenSceneGraph Users
 Subject: Re: [osg-users] How to update image data

 Hi,

 are you calling setImage only once? Are you using osg::Image::NO_DELETE?
 How are you changing the data? Do you get the first image correctly?

 jp

 On 19/07/2011 16:09, clement@csiro.au wrote:
 I tried, but it is no update.  Is there a function from viewer to update the 
 screen?
 
 From: osg-users-boun...@lists.openscenegraph.org 
 [osg-users-boun...@lists.openscenegraph.org] On Behalf Of J.P. Delport 
 [jpdelp...@csir.co.za]
 Sent: Tuesday, 19 July 2011 11:39 PM
 To: OpenSceneGraph Users
 Subject: Re: [osg-users] How to update image data

 see the dirty() function

 On 19/07/2011 14:10, clement@csiro.au wrote:
 Hi,

I used the Image to display data.  I used setImage and assigned I 
 defined unsigned char pointer.  My question is how to let viewer to know to 
 update the view after completed updated the 

Re: [osg-users] How to update image data

2011-07-20 Thread Clement.Chu
Hi Robert,

   I tried some examples (not volume example).  They worked.  I am using 
windows xp and ms visual studio .net.  Now I am trying to replace old coin3D 
codes with osg.  So far I found one example related to volume for my reference. 
 Do you have any good example for my reference?  Thanks.


Clement

From: osg-users-boun...@lists.openscenegraph.org 
[osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield 
[robert.osfi...@gmail.com]
Sent: Thursday, 21 July 2011 1:56 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] How to update image data

Hi Clement,

I have read this thread but can't work out from what you have written
might be wrong.  Have you succeeded in loading some volume data with
the osgvolume example?  What hardware/OS/OSG version are you using?

Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] How to update image data

2011-07-19 Thread Clement.Chu
Hi,

I used the Image to display data.  I used setImage and assigned I defined 
unsigned char pointer.  My question is how to let viewer to know to update the 
view after completed updated the data into image.


Regards,
Clement
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] How to update image data

2011-07-19 Thread Clement.Chu
I tried, but it is no update.  Is there a function from viewer to update the 
screen?

From: osg-users-boun...@lists.openscenegraph.org 
[osg-users-boun...@lists.openscenegraph.org] On Behalf Of J.P. Delport 
[jpdelp...@csir.co.za]
Sent: Tuesday, 19 July 2011 11:39 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] How to update image data

see the dirty() function

On 19/07/2011 14:10, clement@csiro.au wrote:
 Hi,

  I used the Image to display data.  I used setImage and assigned I 
 defined unsigned char pointer.  My question is how to let viewer to know to 
 update the view after completed updated the data into image.


 Regards,
 Clement
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

--
This message is subject to the CSIR's copyright terms and conditions, e-mail 
legal notice, and implemented Open Document Format (ODF) standard.
The full disclaimer details can be found at 
http://www.csir.co.za/disclaimer.html.

This message has been scanned for viruses and dangerous content by MailScanner,
and is believed to be clean.

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] How to update image data

2011-07-19 Thread Clement.Chu
Hi,

   I used the following codes to create Volume data display.

osg::ref_ptrosg::Image osgImage = new osg::Image;
osg::ref_ptrosgVolume::Volume osgVolume = new osgVolume::Volume;
osg::ref_ptrosgVolume::VolumeTile osgTile = new osgVolume::VolumeTile;

osg::ref_ptrosgVolume::ImageLayer  osgLayer = new 
osgVolume::ImageLayer(osgImage.get());
osgTile-setLayer(osgLayer.get());
osgVolume-addChild(osgTile.get());

osgVolume::AlphaFuncProperty* ap = new osgVolume::AlphaFuncProperty(0.02f);
osgVolume::SampleDensityProperty* sd = new 
osgVolume::SampleDensityProperty(0.005);
osgVolume::TransparencyProperty* tp = new 
osgVolume::TransparencyProperty(1.0);
osgVolume::TransferFunctionProperty* tfp = new 
osgVolume::TransferFunctionProperty(osgTransFunc.get());

osgVolume::CompositeProperty* cp = new osgVolume::CompositeProperty;
cp-addProperty(ap);
cp-addProperty(sd);
cp-addProperty(tp);
cp-addProperty(tfp);

osgLayer-addProperty(cp);
osgTile-setVolumeTechnique(new osgVolume::RayTracedTechnique);

   The above codes are used on initializing.  I created the image pointer and 
assigned to image layer.  Then I will use setImage method to assign I defined 
the data pointer.

   osgImage-setImage(nx, ny, nz, 4, GL_RGBA, GL_UNSIGNED_BYTE, pdisp_ptr, 
osg::Image::NO_DELETE, 1);  
   //  where nx, ny, nz are size of data (width, height, depth);
   //  where pdisp_ptr is assigned for using defined data


   //Then  I also used the following codes to set the size of volume data.  I 
wonder whether I need the following codes if I already the size into image 
pointer.
   osg::ref_ptrosg::RefMatrix matrix = new osg::RefMatrix(nx, 0.0,   0.0,   
0.0,

0.0,   ny, 0.0,   0.0,

0.0,   0.0,   nx, 0.0,

0.0,   0.0,   0.0,   1.0);

   osgLayer-setLocator(new osgVolume::Locator(*matrix));
   osgTile-setLocator(new osgVolume::Locator(*matrix));


   Then I will try to assign the data value to pdisp_ptr.  After that, I will 
call osgImage-dirty().   But there is no changed on viewer.  Any idea?  This 
is my  first time to use osg on my application, so I am not sure whether my 
code is crroect.



Clement




From: osg-users-boun...@lists.openscenegraph.org 
[osg-users-boun...@lists.openscenegraph.org] On Behalf Of J.P. Delport 
[jpdelp...@csir.co.za]
Sent: Wednesday, 20 July 2011 1:00 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] How to update image data

Hi,

are you calling setImage only once? Are you using osg::Image::NO_DELETE?
How are you changing the data? Do you get the first image correctly?

jp

On 19/07/2011 16:09, clement@csiro.au wrote:
 I tried, but it is no update.  Is there a function from viewer to update the 
 screen?
 
 From: osg-users-boun...@lists.openscenegraph.org 
 [osg-users-boun...@lists.openscenegraph.org] On Behalf Of J.P. Delport 
 [jpdelp...@csir.co.za]
 Sent: Tuesday, 19 July 2011 11:39 PM
 To: OpenSceneGraph Users
 Subject: Re: [osg-users] How to update image data

 see the dirty() function

 On 19/07/2011 14:10, clement@csiro.au wrote:
 Hi,

   I used the Image to display data.  I used setImage and assigned I 
 defined unsigned char pointer.  My question is how to let viewer to know to 
 update the view after completed updated the data into image.


 Regards,
 Clement
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

 --
 This message is subject to the CSIR's copyright terms and conditions, e-mail 
 legal notice, and implemented Open Document Format (ODF) standard.
 The full disclaimer details can be found at 
 http://www.csir.co.za/disclaimer.html.

 This message has been scanned for viruses and dangerous content by 
 MailScanner,
 and is believed to be clean.

 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

--
This message is subject to the CSIR's copyright terms and conditions, e-mail 
legal notice, and implemented Open Document Format (ODF) standard.
The full disclaimer details can be found at 
http://www.csir.co.za/disclaimer.html.

This message has been scanned for viruses and dangerous content by MailScanner,
and is believed to be clean.


[osg-users] Colour limit

2011-07-08 Thread Clement.Chu
Hi,

I am interested to replace my current 3D library with osg. It is very 
helpful if someone can answer the following questions:

1. What is the colour bit of osg?
2. How many colours does osd support?
3. Does osg support GPU?
4. Does osg support parallel?
5. Does osg support multiple volume rendering?


Thank you!

Cheers,
Clement
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org