Skip to content

Prepass Pixel Shader Output ID? #244

Answered by pragma37
eballeste asked this question in Q&A
Discussion options

You must be logged in to vote

The ID is just a unique identifier. By default, the first channel (ID.x) is a unique number for each object, and the other 3 channels are just 0.

The line_width function can detect id boundaries for each channel:

It's best to avoid changing the value of the first channel, since it's used for detecting self shadows too.

Keep in mind that, since it's a uvec4, it stores values as unsigned integer numbers, so it doesn't take decimals into account.

Replies: 2 comments 8 replies

Comment options

You must be logged in to vote
5 replies
@eballeste
Comment options

@eballeste
Comment options

@pragma37
Comment options

@eballeste
Comment options

@eballeste
Comment options

Answer selected by eballeste
Comment options

You must be logged in to vote
3 replies
@pragma37
Comment options

@eballeste
Comment options

@eballeste
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants