drawing static image as the background

Someone can help you.

drawing static image as the background

PostPosted by atai » 17 Jan 2016, 12:02

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
Last edited by atai on 17 Jan 2016, 22:13, edited 3 times in total.
User avatar
atai
Have some posts
Have some posts
 
Posts: 31
Joined: 28 Dec 2015, 00:28

Re: drawing static image as the background

PostPosted by carnalis » 17 Jan 2016, 21:59

You may want to check "Static Background in 3D Scene" thread:
topic945.html
<Patrician|Away> what does your robot do, sam
<bovril> it collects data about the surrounding environment, then discards it and drives into walls
carnalis
Moderator
Moderator
 
Posts: 180
Joined: 21 Jan 2014, 19:00
Location: United States

Re: drawing static image as the background

PostPosted by atai » 20 Jan 2016, 19:56

carnalis wrote:You may want to check "Static Background in 3D Scene" thread:
topic945.html



Thanks. Using a quad in the rendering path before scene pass works, as suggested in that thread.
User avatar
atai
Have some posts
Have some posts
 
Posts: 31
Joined: 28 Dec 2015, 00:28

Re: drawing static image as the background

PostPosted by sabotage3d » 03 Nov 2016, 00:08

Hey guys can someone share a renderpath example for this?
User avatar
sabotage3d
Have many posts
Have many posts
 
Posts: 515
Joined: 25 Oct 2014, 13:26

Re: drawing static image as the background

PostPosted by 1vanK » 03 Nov 2016, 17:30

Image

Modified Forward.xml:
Code: Select all
<renderpath>
    <command type="clear" color="fog" depth="1.0" stencil="0" />
   
    <!-- 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" />
</renderpath>


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.
User avatar
1vanK
Moderator
Moderator
 
Posts: 430
Joined: 26 Jun 2015, 19:16
Location: Internet

Re: drawing static image as the background

PostPosted by sabotage3d » 03 Nov 2016, 21:28

Thanks a lot. Works like a charm.
User avatar
sabotage3d
Have many posts
Have many posts
 
Posts: 515
Joined: 25 Oct 2014, 13:26

Re: drawing static image as the background

PostPosted by Petryk » 20 Dec 2016, 11:51

Thanks for example of renderpath! Good job! Does anybody know how to create shader with fixing texture issue?
User avatar
Petryk
New user
New user
 
Posts: 1
Joined: 20 Dec 2016, 11:44


Return to Support

Who is online

Users browsing this forum: No registered users and 0 guests

cron