comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Question about volume objects and opacity
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Question about volume objects and opacity [message #45701] Sat, 01 October 2005 01:00
Klemens Barfus is currently offline  Klemens Barfus
Messages: 45
Registered: December 2002
Member
Hi Karl, Hi Dick !

thanks for your explanations !
Differences are not really visible, but I tried to understand whats the
reason for the differences. Now I know them because of your explanations
! Thanks again !

Klemens
Re: Question about volume objects and opacity [message #45702 is a reply to message #45701] Fri, 30 September 2005 14:57 Go to previous message
Dick Jackson is currently offline  Dick Jackson
Messages: 347
Registered: August 1998
Senior Member
Hi Klemens,

Karl's explanation covers the issue, I just thought I'd offer a suggestion
as you're testing what these things will look like.

After you make each model, you can toss it to XObjView for simple viewing
(with a default lighting arrangement that you can change).

In your code, this can finish off your first section:

oModel_vol->add,oVol_vol
oModel_vol->rotate,[1,0,0],-89
XObjView, oModel_vol, Title='Volume_example'

... and this would be the end of the second section

oModel_sur->rotate,[1,0,0],-89
XObjView, oModel_sur, Title='Surface_example', XOffset=420

You can comment out your lines about views and windows. When the XObjView
windows come up, you can view your two versions from all angles.

Hope this is helpful.

Cheers,
-Dick

Dick Jackson / dick@d-jackson.com
D-Jackson Software Consulting / http://www.d-jackson.com
Calgary, Alberta, Canada / +1-403-242-7398 / Fax: 241-7392

"Karl Schultz" <k____schultz@rsinc.com> wrote in message
news:pan.2005.09.30.21.20.29.156000@rsinc.com...
> On Fri, 30 Sep 2005 19:31:29 +0200, Klemens Barfus wrote:
>
>> Dear list members,
>>
>> trying to visualize three dimensional cloud fields, I started to work
>> with object graphics. I created a testcase to get the differences
>> between volume objects and polygon objects to decide which object to use.
>>
>> What I do not understand is the attribute opacity of the volume objects.
>> In the code below opacity is 255 and therefor all the volumes should be
>> opac and have the same colour. The polygon graphic should look like the
>> volume graphic, or not ?
>> But in the areas where there are more voxels in direction of the view,
>> colour is a little bit more solid then in the areas where there is just
>> one filled voxel.
>>
>> Is there something wrong in my understanding of volume objects ?
>>
>> Thanks for your help in advance !
>>
>> Klemens
>
> I think your understanding is correct. The volume renderer implementation
> takes some shortcuts in the name of efficiency. It uses integer math when
> it can. It also pre-multiplies the color table by the opacity table.
> Keeping integer math in mind, you can see that 0xff * 0xff = 0xfe01, and
> if you normalize that back to 8 bits, you get 0xfe. So your effective
> color for 100% red is really [254, 0, 0]. That's not the entire story,
> but you get the idea. I suppose that you can argue that it is a bug, but
> it may also be a planned shortcoming as a trade-off for speed.
>
> I also point out that I really could not *visually* see the problem your
> program demonstrates. I had to read the pixels back from the window and
> examine them to see that the reds ranged from 247-255. Maybe I could see
> the difference between a block of pixels with color [247,0,0] and a block
> of [255,0,0] if they were right up next to each other, but I wouldn't be
> able to detect this difference in any other situation. I don't know if the
> difference is significant for you or not.
>
> That's the explanation.
>
> Karl
>
Re: Question about volume objects and opacity [message #45703 is a reply to message #45702] Fri, 30 September 2005 14:20 Go to previous message
Karl Schultz is currently offline  Karl Schultz
Messages: 341
Registered: October 1999
Senior Member
On Fri, 30 Sep 2005 19:31:29 +0200, Klemens Barfus wrote:

> Dear list members,
>
> trying to visualize three dimensional cloud fields, I started to work
> with object graphics. I created a testcase to get the differences
> between volume objects and polygon objects to decide which object to use.
>
> What I do not understand is the attribute opacity of the volume objects.
> In the code below opacity is 255 and therefor all the volumes should be
> opac and have the same colour. The polygon graphic should look like the
> volume graphic, or not ?
> But in the areas where there are more voxels in direction of the view,
> colour is a little bit more solid then in the areas where there is just
> one filled voxel.
>
> Is there something wrong in my understanding of volume objects ?
>
> Thanks for your help in advance !
>
> Klemens

I think your understanding is correct. The volume renderer implementation
takes some shortcuts in the name of efficiency. It uses integer math when
it can. It also pre-multiplies the color table by the opacity table.
Keeping integer math in mind, you can see that 0xff * 0xff = 0xfe01, and
if you normalize that back to 8 bits, you get 0xfe. So your effective
color for 100% red is really [254, 0, 0]. That's not the entire story,
but you get the idea. I suppose that you can argue that it is a bug, but
it may also be a planned shortcoming as a trade-off for speed.

I also point out that I really could not *visually* see the problem your
program demonstrates. I had to read the pixels back from the window and
examine them to see that the reds ranged from 247-255. Maybe I could see
the difference between a block of pixels with color [247,0,0] and a block
of [255,0,0] if they were right up next to each other, but I wouldn't be
able to detect this difference in any other situation. I don't know if the
difference is significant for you or not.

That's the explanation.

Karl
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Linux Font Warning
Next Topic: how to use map_set in object graphics programming

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 10:29:59 PDT 2025

Total time taken to generate the page: 0.48105 seconds