[Ves] Kiwi transparent background

Jurre Hanema jurre at stack.nl
Tue Oct 22 11:11:30 EDT 2013


After failed attempts with the blend attributes, I simply solved my 
problem by removing the background from the camera in the renderer:

phxRenderer::phxRenderer(): vesRenderer()
{
     this->camera()->removeChild(this->background());
this->camera()->setClearMask(vesStateAttributeBits::ColorBufferBit | 
vesStateAttributeBits::DepthBufferBit);
}

(I created the subclass phxRenderer for this because I want to keep my 
changes local to my application)

-- Jurre

On 19/10/13 01:14, Aashish Chaudhary wrote:
> On Fri, Oct 18, 2013 at 2:24 PM, <jurre at stack.nl 
> <mailto:jurre at stack.nl>> wrote:
>
>     Thanks, I think I can figure most of it out from here. I am new to
>     VES, so I wonder what is the reasoning for encapsulating the
>     functionality I need in a class vesBackground::vesInternal, thus
>     hiding it from the headers and documentation?
>
>
> We can expose this feature now. We just didn't have the requirement at 
> that time and it should be easy to add. If you happen to add this 
> feature, send a patch to us so that we can push it upstream (you as 
> the author). *I should note that this may cause some issues to your 
> transparent objects in the scene  though. You may have to use a 
> different blend equation if you chose to make the background 
> transparent. *
>
> Thanks,
>
>
>     -- Jurre
>
>     Quoting "Aashish Chaudhary" <aashish.chaudhary at kitware.com
>     <mailto:aashish.chaudhary at kitware.com>>:
>
>         Hi Jurre,
>
>         You will have to add blend attribute as well (vesBlend).  The
>         default blend
>         equation probably will work for you. Have a look at the
>         vesBackground.cpp.
>          Let us know if you need any help.
>
>         - Aashish
>
>
>
>         On Tue, Oct 15, 2013 at 1:30 PM, Jurre Hanema <jurre at stack.nl
>         <mailto:jurre at stack.nl>> wrote:
>
>             Hi,
>
>             I am developing an app based on the KiwiViewer code.
>             Objects should be
>             rendered on a transparent background instead of the
>             standard blue one, such
>             that another Android layer (a camera view, in this case)
>             can be displayed
>             behind it.
>
>             To achieve this, I have modified the function declaration
>             and definition
>             of vesKiwiBaseApp::**setBackgroundColor() such as to
>             expose the
>             alpha-argument of vesRenderer::**setBackgroundColor():
>
>             void vesKiwiBaseApp::**setBackgroundColor(double r, double
>             g, double b,
>             double alpha)
>             {
>               this->Internal->Renderer->**setBackgroundColor(r, g, b,
>             alpha);
>
>             }
>
>             In KiwiNative.cpp, I can now call
>             app->setBackgroundColor() as follows:
>
>             bool loadDataset(const std::string& filename, int
>             builtinDatasetIndex)
>             {
>               // ...
>               app->setBackgroundColor(255, 0, 0, 0);
>               // ...
>             }
>
>             Alas, this changes the background color to solid red
>             instead of
>             transparency.
>
>             How to achieve rendering on a transparent background with
>             Kiwi?
>
>             Regards,
>             Jurre
>             ______________________________**_________________
>             Ves mailing list
>             Ves at public.kitware.com <mailto:Ves at public.kitware.com>
>             http://public.kitware.com/cgi-**bin/mailman/listinfo/ves<http://public.kitware.com/cgi-bin/mailman/listinfo/ves>
>
>
>
>
>         --
>         | Aashish Chaudhary
>         | R&D Engineer
>         | Kitware Inc.
>         | www.kitware.com <http://www.kitware.com>
>
>
>
>
>
> -- 
> | Aashish Chaudhary
> | R&D Engineer
> | Kitware Inc.
> | www.kitware.com <http://www.kitware.com>




More information about the Ves mailing list