Harbor

branch main
showing the latest snapshot on main
vertex_old.luma 488 B · Plain text
gpu/shader/tests/equivalence/vertex_old.luma 0644 Raw
struct Uniforms
	model: mat4
	view_proj: mat4
	normal_mat: mat4
end

uniform uniforms: Uniforms

@entry(vertex)
function transform(position: vec3, normal: vec3, uv: vec2) -> (@builtin(position) position: vec4, uv: vec2, normal: vec3)
	let pos = position
	let world_pos = uniforms.model * vec4(pos, 1.0)
	let clip_pos = uniforms.view_proj * world_pos
	return _transform_Output {
		position = clip_pos,
		uv = uv,
		normal = normalize((uniforms.normal_mat * vec4(normal, 0.0)).xyz),
	}
end