Archive 17/01/2023.

Show ui element behind 3d model

redmouth

How to display 3d model in front of UI elements, such as a button.

Dave82

The easiest way is create a custom pass.If you define a pass after “renderui” then all these models will appear on top of the UI elements

Create a renderpath like this :


<renderpath>
	<command type="renderui"/>
    <command type="clear" depth="1.0" />
    <command type="scenepass" pass="TopObjects"/>
</renderpath> 

Now create a custom technique for your models.
Example (An unlit model with diffuse texture)

<technique vs="Unlit" ps="Unlit" psdefines="DIFFMAP" >
	<pass name="TopObjects"/>
</technique>

Using this technique on models will draw them on top of uielements

yushli1

Thank you for your reply. I learned something from your method.