Ray tracing texturing and alpha mapping sample
This commit is contained in:
parent
5645c2657f
commit
d0ad204606
11 changed files with 49 additions and 8 deletions
|
|
@ -1,4 +1,11 @@
|
|||
/* Copyright (c) 2023, Sascha Willems
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#version 460
|
||||
|
||||
#extension GL_EXT_ray_tracing : require
|
||||
#extension GL_GOOGLE_include_directive : require
|
||||
#extension GL_EXT_nonuniform_qualifier : require
|
||||
|
|
@ -9,14 +16,16 @@
|
|||
layout(location = 0) rayPayloadInEXT vec3 hitValue;
|
||||
hitAttributeEXT vec2 attribs;
|
||||
|
||||
#include "_bufferreferences.glsl"
|
||||
#include "_geometrytypes.glsl"
|
||||
layout(binding = 3, set = 0) uniform sampler2D image;
|
||||
|
||||
#include "bufferreferences.glsl"
|
||||
#include "geometrytypes.glsl"
|
||||
|
||||
void main()
|
||||
{
|
||||
Triangle tri = unpackTriangle(gl_PrimitiveID, 32);
|
||||
hitValue = vec3(tri.uv, 0.0f);
|
||||
// Fetch the color for this ray hit from the texture at the current uv coordinates
|
||||
vec4 color = texture(image, tri.uv);
|
||||
hitValue = color.rgb;
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue