fix texture format

This commit is contained in:
Piotrek
2021-04-23 14:32:45 +02:00
parent 936c0f2e18
commit 8368545e6c
5 changed files with 22 additions and 12 deletions
Binary file not shown.
+6 -1
View File
@@ -19,6 +19,11 @@ vec3 solve(vec3 point, vec3 view, vec3 normal)
return (ambient + diffuse + specular) * object_color;
}
vec3 castBricks(vec3 origin, vec3 dir)
{
}
vec3 castNodes(vec3 origin, vec3 dir)
{
// Round input pos to nearest voxel
@@ -37,7 +42,7 @@ vec3 castNodes(vec3 origin, vec3 dir)
for(int i=0;i<50;i++)
{
// Get node
uint node = texelFetch(diffuseTex, ivec3(pos), 0).r;
uint node = texelFetch(nodesTexture, ivec3(pos), 0).r;
if(node != 0)
{
// Hit point
+2 -1
View File
@@ -14,7 +14,8 @@ layout(set=0, binding=0) uniform Uniforms
//layout(set = 1, binding = 0) uniform texture3D node_tex;
//layout(set = 1, binding = 1) uniform usampler3D node_sampl;
layout(set=1,binding=0) uniform usampler3D diffuseTex;
layout(set=1,binding=0) uniform usampler3D nodesTexture;
layout(set=2,binding=0) uniform usampler3D bricksTexture;
// Defines
#define PI 3.141592