Jump to content

Problem with Z-sort and render to texture


Genebris
 Share

Recommended Posts

Material with Z-sort enabled works incorrectly when rendered to a texture. See the screenshot.

Green and grey materials are regular, blue mat has z-sort enabled. Right part of the image is rendered normally, left part is rendered to a texture and drawn on the context.

 

post-11962-0-48005100-1481312515_thumb.png

 

You can see that blue cube on the left is visible through the grey cube. I need to have z-sort enabled for my particles with UV animation, but it makes them visible through the walls.

 

Script on the camera in this scene:


function Script:Start()

self.tex = Texture:Create(512,512)

self.cam = Camera:Create()

self.cam:SetRenderTarget(self.tex)

end

 

function Script:PostRender(context)

context:SetBlendMode(Blend.Alpha)

context:DrawImage(self.tex,-180,0,512,512)

end

  • Upvote 1
Link to comment
Share on other sites

  • 2 weeks later...

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...