Dzsozi (h03)

Green screen shader

Recommended Posts

What about the post-processing? It is possible to color some object with world-shader and then just cut off all the rest by post-processing. Or use the depth buffer to remove a background.

Share this post


Link to post
14 hours ago, TEDERIs said:

What about the post-processing? It is possible to color some object with world-shader and then just cut off all the rest by post-processing. Or use the depth buffer to remove a background.

And how do I do that? I don't know.

Share this post


Link to post
15 hours ago, Dzsozi (h03) said:

And how do I do that? I don't know.

Just use the code above to render your object with any contrast color. Then write simple post-processing shader, that finds the contrast color, converts it to black-n-white and delimits your object from a background. In case of the depth buffer, you might use the example from wiki . It probably also will require hiding of all world objects. For this is possible to use vertex shader that moves all vertices far away.

By the way, a sample of the second approach you can watch here

Edited by TEDERIs
Additional info

Share this post


Link to post
17 hours ago, TEDERIs said:

Just use the code above to render your object with any contrast color. Then write simple post-processing shader, that finds the contrast color, converts it to black-n-white and delimits your object from a background. In case of the depth buffer, you might use the example from wiki . It probably also will require hiding of all world objects. For this is possible to use vertex shader that moves all vertices far away.

By the way, a sample of the second approach you can watch here

I do not know how to write shader files.

Share this post


Link to post
On 25.05.2018 at 01:50, TEDERIs said:

What about the post-processing? It is possible to color some object with world-shader and then just cut off all the rest by post-processing. Or use the depth buffer to remove a background.

You can render the object to render target and the modify output as you want. Example in the link: 
https://bugs.mtasa.com/view.php?id=8769

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.