-
-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8eed6b3
commit d5cf6c2
Showing
4 changed files
with
22 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 4 additions & 5 deletions
9
src/renderer/material/shaders/geometry_instance_material.frag
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,14 @@ | ||
uniform float id; | ||
uniform int id; | ||
uniform vec3 eye; | ||
|
||
flat in int instanceID; | ||
|
||
in vec3 pos; | ||
in vec4 col; | ||
|
||
layout (location = 0) out vec4 outColor; | ||
|
||
void main() | ||
{ | ||
float instanceID = -col.x; | ||
|
||
float dist = distance(pos, eye); | ||
outColor = vec4(dist, id, instanceID, 1.0); | ||
outColor = vec4(dist, float(id), float(instanceID), 1.0); | ||
} |