Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>texture with alpha does works in wpf ( it works for me ! ). are you sure your png alpha is ok ?</p> <p>a png with alpha in a DiffuseMaterial il all you need. here's a chunk of xaml with a camera over two textured planar meshes.</p> <p>replace the path of the png, put it in a xaml file and launch. you should be able to see material2 behind alpha of material1.</p> <pre><code>&lt;Grid xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Width="640.0" Height="480.0" &gt; &lt;Grid.Resources&gt; &lt;MeshGeometry3D x:Key="Mesh" Positions="-4.999,-4.999,0.001 5.001,-4.999,0.001 -4.999,5.001,0.001 5.001,5.001,0.001 " TriangleIndices="2 0 3 1 3 0 " TextureCoordinates="0,0 1,0 0,1 1,1 " /&gt; &lt;DiffuseMaterial x:Key="material1" &gt; &lt;DiffuseMaterial.Brush&gt; &lt;ImageBrush ImageSource="C:\mypng.png" Transform="1,0,0,-1,0,1" /&gt; &lt;/DiffuseMaterial.Brush&gt; &lt;/DiffuseMaterial&gt; &lt;DiffuseMaterial x:Key="material2" &gt; &lt;DiffuseMaterial.Brush&gt; &lt;ImageBrush ImageSource="C:\image_4.png" Transform="1,0,0,-1,0,1" /&gt; &lt;/DiffuseMaterial.Brush&gt; &lt;/DiffuseMaterial&gt; &lt;/Grid.Resources&gt; &lt;Viewport3D Width="640.0" Height="480.0" &gt; &lt;Viewport3D.Camera&gt; &lt;PerspectiveCamera Position="0,0,20"/&gt; &lt;/Viewport3D.Camera&gt; &lt;ModelVisual3D&gt; &lt;ModelVisual3D.Content&gt; &lt;Model3DGroup &gt; &lt;AmbientLight /&gt; &lt;GeometryModel3D Geometry="{StaticResource Mesh}" Material="{StaticResource material2}"&gt; &lt;GeometryModel3D.Transform&gt; &lt;MatrixTransform3D Matrix="1.0,0.0,0.0,0,0.0,1.0,0.0,0,0.0,0.0,1.0,0,0.0,0.0,-5.0,1" /&gt; &lt;/GeometryModel3D.Transform&gt; &lt;/GeometryModel3D&gt; &lt;GeometryModel3D Geometry="{StaticResource Mesh}" Material="{StaticResource material1}"&gt; &lt;GeometryModel3D.Transform&gt; &lt;MatrixTransform3D Matrix="1.0,0.0,0.0,0,0.0,1.0,0.0,0,0.0,0.0,1.0,0,0.0,0.0,0.0,1" /&gt; &lt;/GeometryModel3D.Transform&gt; &lt;/GeometryModel3D&gt; &lt;/Model3DGroup&gt; &lt;/ModelVisual3D.Content&gt; &lt;/ModelVisual3D&gt; &lt;/Viewport3D&gt; &lt;/Grid&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload