Hi, what is the best way to render a static image as the background, such that all the other rendering objects appear on top of and cover the background image, but the background image will fill the viewport and show up where no other rendering object exist? Think this background in the same manner as the static desktop background image, but here this is for the background of a viewport in a Urho3d rendering area or window
Drawing static image as the background
You may want to check “Static Background in 3D Scene” thread:
topic945.html
[quote=“carnalis”]You may want to check “Static Background in 3D Scene” thread:
topic945.html
[/quote]
Thanks. Using a quad in the rendering path before scene pass works, as suggested in that thread.
Hey guys can someone share a renderpath example for this?
Modified Forward.xml:
[code]
<!-- Added -->
<command type="quad" vs="CopyFramebuffer" ps="CopyFramebuffer" output="viewport">
<texture unit="diffuse" name="Textures/UrhoDecal.dds" />
</command>
<command type="scenepass" pass="base" vertexlights="true" metadata="base" />
<command type="forwardlights" pass="light" />
<command type="scenepass" pass="postopaque" />
<command type="scenepass" pass="refract">
<texture unit="environment" name="viewport" />
</command>
<command type="scenepass" pass="alpha" vertexlights="true" sort="backtofront" metadata="alpha" />
<command type="scenepass" pass="postalpha" sort="backtofront" />
[/code]
In OpenGL texture is flipped. Also texture is stretched in full screen, so it looks different for 4x3 and 16x9 screens. U need make own shader and fix it.
Thanks a lot. Works like a charm.
Thanks for example of renderpath! Good job! Does anybody know how to create shader with fixing texture issue?