Запись ID объекта в текстуру
This commit is contained in:
@@ -15,6 +15,7 @@ layout (location = 0) out vec3 gPosition;
|
||||
layout (location = 1) out vec3 gNormal;
|
||||
layout (location = 2) out vec4 gDiffuseP;
|
||||
layout (location = 3) out vec4 gAmbientSpecular;
|
||||
layout (location = 4) out uvec3 gID;
|
||||
|
||||
in vec3 vertex; // Позиция вершины в пространстве
|
||||
in vec3 N; // Нормаль трансформированноая
|
||||
@@ -31,6 +32,8 @@ uniform sampler2D tex_normal;
|
||||
|
||||
uniform float parallax_heightScale = 0.1;
|
||||
|
||||
uniform uvec3 ID = uvec3(0);
|
||||
|
||||
void main()
|
||||
{
|
||||
// Сформируем TBN матрицу
|
||||
@@ -103,4 +106,6 @@ void main()
|
||||
gAmbientSpecular.rgb = texture(tex_ambient, new_texCoord).rgb * ka;
|
||||
// Сохранение зеркальной составляющей
|
||||
gAmbientSpecular.a = texture(tex_specular, new_texCoord).r * ks.r;
|
||||
// Сохранение идентификатора объекта
|
||||
gID = ID;
|
||||
}
|
||||
Reference in New Issue
Block a user