EEVEE Next: GI surfels debug display #105802
|
@ -17,8 +17,8 @@ void GI::generate_random_surfels()
|
|||
|
||||
for (Surfel &surfel : surfels) {
|
||||
float3 random = rng.get_unit_float3();
|
||||
surfel.position = float4(random * 3.0f);
|
||||
surfel.normal = float4(random);
|
||||
surfel.position = random * 3.0f;
|
||||
surfel.normal = random;
|
||||
surfel.color = float4(rng.get_float(), rng.get_float(), rng.get_float(), 1.0f);
|
||||
}
|
||||
|
||||
|
|
|
@ -831,8 +831,10 @@ static inline ShadowTileDataPacked shadow_tile_pack(ShadowTileData tile)
|
|||
* \{ */
|
||||
|
||||
struct Surfel {
|
||||
pragma37 marked this conversation as resolved
Outdated
|
||||
float4 position;
|
||||
float4 normal;
|
||||
float3 position;
|
||||
pragma37 marked this conversation as resolved
Clément Foucault
commented
Use Use `packed_float3` if you do that.
|
||||
int _pad0;
|
||||
float3 normal;
|
||||
int _pad1;
|
||||
float4 color;
|
||||
};
|
||||
BLI_STATIC_ASSERT_ALIGN(Surfel, 16)
|
||||
|
|
|
@ -5,7 +5,7 @@ void main()
|
|||
out_color = surfel.color;
|
||||
|
||||
/* Display surfels as circles. */
|
||||
if (distance(P, surfel.position.xyz) > surfel_radius) {
|
||||
if (distance(P, surfel.position) > surfel_radius) {
|
||||
discard;
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -9,14 +9,14 @@ void main()
|
|||
const vec3 verts[4] = vec3[4](vec3(-1, 1, 0), vec3(-1, -1, 0), vec3(1, 1, 0), vec3(1, -1, 0));
|
||||
pragma37 marked this conversation as resolved
Outdated
Clément Foucault
commented
Prefer using a switch for compatibility with Metal. Prefer using a switch for compatibility with Metal.
|
||||
vec3 lP = verts[gl_VertexID];
|
||||
|
||||
vec3 N = surfel.normal.xyz;
|
||||
vec3 N = surfel.normal;
|
||||
vec3 T, B;
|
||||
make_orthonormal_basis(N, T, B);
|
||||
|
||||
mat4 model_matrix = mat4(vec4(T * surfel_radius, 0),
|
||||
vec4(B * surfel_radius, 0),
|
||||
vec4(N * surfel_radius, 0),
|
||||
vec4(surfel.position.xyz, 1));
|
||||
vec4(surfel.position, 1));
|
||||
|
||||
P = (model_matrix * vec4(lP, 1)).xyz;
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Rename to
DebugSurfel
So the idea would be to eventually have a Surfel and a DebugSurfel and make the copy/conversion before rendering the debug visualization?
Yes. I'm thinking we could reuse it for raytracing debugging.