All Downloads are FREE. Search and download functionalities are using the official Maven repository.

Standard.Shader.GBuffer.albedo.frag Maven / Gradle / Ivy

There is a newer version: 0.0.1-alpha1
Show newest version
#version 450
#extension GL_ARB_separate_shader_objects:enable

const int MAX_NUM_TEXTURES=1024;
const int SIZEOF_FLOAT=4;
const int SIZEOF_INT=4;

layout(set=1,binding=0) uniform texture2D textures[MAX_NUM_TEXTURES];
layout(set=2,binding=0) uniform sampler textureSampler;
layout(push_constant) uniform FragPC{
    layout(offset=1*16*SIZEOF_FLOAT+1*SIZEOF_INT) int textureIndex;
}pc;

layout(location=0) in vec4 fragColor;
layout(location=1) in vec2 fragTexCoords;

layout(location=0) out vec4 outAlbedo;

void main(){
    outAlbedo=texture(sampler2D(textures[pc.textureIndex],textureSampler),fragTexCoords)*fragColor;
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy