Samples with transparency?
I've been loading some of the samples to test my integration, and wanted to test a partially-transparent one over the top of rendering a world, but can't seem to find any samples that are set up this way (or I have, and my handling of transparency is clearly not working!)
Anything fairly simple I can use?
Anything fairly simple I can use?
-
sfernandez
Site Admin
- Posts: 2983
- Joined:
Re: Samples with transparency?
If you need a simple XAML to test transparecency that is using the Offscreen render you can use this:
As explained in the integration tutorial you have to call RenderOffscreen before actually rendering your scene:
Code: Select all
<Grid
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Border BorderBrush="Black" BorderThickness="20" Margin="20" Opacity="0.5">
<Rectangle Width="200" Height="100" Fill="Red"/>
</Border>
</Grid>
Code: Select all
mView->Update(timeInSeconds);
// Offscreen pass
mView->GetRenderer()->UpdateRenderTree();
mView->GetRenderer()->RenderOffscreen();
// Set main render target and set correct GPU state
// Render scene
// Onscreen pass
mView->GetRenderer()->Render();
// Swap buffers and Present
Who is online
Users browsing this forum: Google [Bot], vinick and 69 guests