A couple small random tweaks while I play with lighting
This commit is contained in:
parent
30d7386805
commit
65ffec18e9
3 changed files with 3 additions and 3 deletions
|
@ -18,7 +18,7 @@ let alignedUniformsSize = (MemoryLayout<Uniforms>.size & ~0xFF) + 0x100
|
||||||
let maxBuffersInFlight = 3
|
let maxBuffersInFlight = 3
|
||||||
|
|
||||||
let terrainDimensions = float2(10, 10)
|
let terrainDimensions = float2(10, 10)
|
||||||
let terrainSegments = uint2(20, 20)
|
let terrainSegments = uint2(5, 5)
|
||||||
|
|
||||||
enum RendererError: Error {
|
enum RendererError: Error {
|
||||||
case badVertexDescriptor
|
case badVertexDescriptor
|
||||||
|
|
|
@ -47,7 +47,7 @@ kernel void updateGeometryNormals(constant packed_float3 *meshPositions [[buffer
|
||||||
float3 side2 = v1 - v3;
|
float3 side2 = v1 - v3;
|
||||||
float3 normal = normalize(cross(side1, side2));
|
float3 normal = normalize(cross(side1, side2));
|
||||||
faceNormals[tid] = normal;
|
faceNormals[tid] = normal;
|
||||||
faceMidpoints[tid] = 0.3333333333 * (v1 + v2 + v3);
|
faceMidpoints[tid] = (1.0 / 3.0) * (v1 + v2 + v3);
|
||||||
}
|
}
|
||||||
|
|
||||||
kernel void updateGeometryVertexNormals()
|
kernel void updateGeometryVertexNormals()
|
||||||
|
|
|
@ -108,7 +108,7 @@ class Terrain: NSObject {
|
||||||
print("Couldn't create algorithm")
|
print("Couldn't create algorithm")
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
(gen as DiamondSquareGenerator).roughness = 0.075
|
gen.roughness = 0.2
|
||||||
generator = gen
|
generator = gen
|
||||||
|
|
||||||
do {
|
do {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue