mirror of
https://github.com/GayPizzaSpecifications/voxelotl-engine.git
synced 2025-08-03 13:11:33 +00:00
use shader uniforms for scaling cube
This commit is contained in:
@ -12,10 +12,14 @@ struct FragmentInput {
|
||||
|
||||
vertex FragmentInput vertexMain(
|
||||
uint vertexID [[vertex_id]],
|
||||
device const ShaderVertex* vtx [[buffer(ShaderInputIdxVertices)]]
|
||||
device const ShaderVertex* vtx [[buffer(ShaderInputIdxVertices)]],
|
||||
constant ShaderUniforms& u [[buffer(ShaderInputIdxUniforms)]]
|
||||
) {
|
||||
auto position = vtx[vertexID].position;
|
||||
position = u.projView * u.model * position;
|
||||
|
||||
FragmentInput out;
|
||||
out.position = vtx[vertexID].position * float4(0.5, 0.5, 0.5, 1.0);
|
||||
out.position = position;
|
||||
out.normal = vtx[vertexID].normal;
|
||||
out.texCoord = vtx[vertexID].texCoord;
|
||||
return out;
|
||||
|
Reference in New Issue
Block a user