Jump to content

Is posible to draw background image and the 3d world drawn on top ?


aiaf
 Share

Go to solution Solved by macklebee,

Recommended Posts

Need to draw an image on screen as background and the 3d world be visible on top of that. Any way to do this ?

 

Found some topic in forums but didnt help, with this  the background image appear only in places where emitters are drawn..

https://www.leadwerks.com/community/topic/10041-is-it-possible-to-draw-an-image-as-background-and-render-over-it/

 

I made this with Leadwerks/UAK:

Structura Stacky Desktop Edition

Website:

Binary Station

Link to comment
Share on other sites

Spent half day trying to make own skybox texture.Tried couple of tools read the forums, created 6x1 tiled textures.But so far no luck creating something that looks ok.So kind of give up and trying to put background image.

 

Code is below:

  foreground->Enable();
  world->Update();
  world->Render();
  foreground->Disable();

context->Enable();
context->SetBlendMode(Blend::Alpha);
context->DrawImage(background1, 0, 0);
context->DrawImage(foreground->GetColorTexture(), 0, 0);
context->SetBlendMode(Blend::Solid);

It doesnt work as i expect , image is transparent and can only see it when camera is above the emitters in my game.

I made this with Leadwerks/UAK:

Structura Stacky Desktop Edition

Website:

Binary Station

Link to comment
Share on other sites

Try this with the understanding that it doesn't play well with sprites or particles:

--insert before main loop
mybuffer = Buffer:Create(window:GetWidth(),window:GetHeight(),1,1) --custom buffer
image = Texture:Load("Materials/Developer/bluegrid.tex") --load the background image

--in the main loop
currentbuffer = Buffer:GetCurrent() --add this
mybuffer:Enable()					--add this

--Render the world
world:Render() 						--this should already be there
	
currentbuffer:Enable()				--add this

context:SetColor(1,1,1,1) 			--add this if using std fpsplayer cuz Josh doesn't clean up his context SetColors!
context:DrawImage(image,0,0,window:GetWidth(),window:GetHeight()) --add this
context:DrawImage(mybuffer:GetColorTexture(0),0,0,window:GetWidth(),window:GetHeight()) --add this

--draw text and images etc after if required

background.thumb.jpg.61b1391d7d441ab31264b5c043d35b7e.jpg

 

  • Like 1

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

Link to comment
Share on other sites

A skybox is what you want since it inherently works with sprites and emitters because LE is controlling the order these items get rendered. You should post an example picture that you are trying to accomplish as I am sure someone can help convert it properly to something useable. 

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

Link to comment
Share on other sites

This is latest atempt i attached all files ,  i used https://pragmar.com/qbit/ to generate the 6 images from original.

Then imagemagick to montage them:

montage -geometry 512 -tile 6x1 s_web_background.left.png s_web_background.right.png s_web_background.up.png s_web_background.down.png s_web_background.front.png s_web_background.back.png output.png

Maybe image need to be of certain type or i didnt montage it the right way. Any help is most welcome thanks

output.png

s_web_background.back.png

s_web_background.down.png

s_web_background.front.png

s_web_background.left.png

s_web_background.right.png

s_web_background.up.png

s_web_background.png

I made this with Leadwerks/UAK:

Structura Stacky Desktop Edition

Website:

Binary Station

Link to comment
Share on other sites

I would suggest that if you use qbit then your initial picture probably needs to be seamless to begin with or you will end up with the hard transitions that these images show. If the individual images have these hard transition lines then of course the cubemap will have them too.

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

Link to comment
Share on other sites

  • Solution
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...