Hi Alex,

Translucent objects requires a singlepass lighting model, which I took the
opportunity to complete and make it the default one.
I put your example with a slight modification under
R3Example>>translucentCubes
Translucent elements require a reception of the message makeTranslucent
since their rendering must be handled in a special way. They must rendered
after all the opaque objects, in a back to front order without depth
writing. Currently only depth writing disabling per element is supported,
so their rendering is not going to be perfect, but at least some
transparency can be seen.

Greetings,
Ronie Salgado


2013/12/23 Igor Stasenko <[email protected]>

>
>
>
> On 23 December 2013 22:04, Alexandre Bergel <[email protected]>wrote:
>
>> Hi!
>>
>> Is there a way to have transparent colors with NBOpenGL?
>> I’ve tried the following (using Roassal 3d):
>>
>> -=-=-=-=-=-=-=-=-=-=
>> | view el1 el2 |
>> view := R3View new.
>> el1 := (R3CubeShape new color: (Color purple alpha: 0.2)) element.
>> el2 := (R3CubeShape new color: (Color purple alpha: 0.2)) element.
>> view add: el1; add: el2.
>>
>> el2 translateByZ: -2.
>>
>> view addInteraction: R3MouseControl new; addInteraction:
>> R3KeyControlForMac new.
>> view open
>> -=-=-=-=-=-=-=-=-=-=
>>
>> But I get something like:
>> Would it be possible to have translucent cubes? Any OpenGL expert around?
>>
>>
> Come on, Alex, sometimes you make me think you just came from the Moon.
>
> http://www.opengl.org/archives/resources/faq/technical/transparency.htm
> http://www.openglsuperbible.com/
> google: opengl transparency
>
>
>> Alexandre
>> --
>> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
>> Alexandre Bergel  http://www.bergel.eu
>> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>>
>>
>>
>>
>
>
> --
> Best regards,
> Igor Stasenko.
>

<<Screen Shot 2013-12-23 at 10.03.37 PM.png>>

<<attachment: translucent.png>>

Reply via email to