Shader: Switch type<subtype> to type[subtype]
This commit is contained in:
@@ -21,50 +21,50 @@ const HasUV = (UvLocation >= 0);
|
||||
struct MaterialSettings
|
||||
{
|
||||
AlphaThreshold: f32,
|
||||
DiffuseColor: vec4<f32>
|
||||
DiffuseColor: vec4[f32]
|
||||
}
|
||||
|
||||
[layout(std140)]
|
||||
struct InstanceData
|
||||
{
|
||||
worldMatrix: mat4<f32>,
|
||||
invWorldMatrix: mat4<f32>
|
||||
worldMatrix: mat4[f32],
|
||||
invWorldMatrix: mat4[f32]
|
||||
}
|
||||
|
||||
[layout(std140)]
|
||||
struct ViewerData
|
||||
{
|
||||
projectionMatrix: mat4<f32>,
|
||||
invProjectionMatrix: mat4<f32>,
|
||||
viewMatrix: mat4<f32>,
|
||||
invViewMatrix: mat4<f32>,
|
||||
viewProjMatrix: mat4<f32>,
|
||||
invViewProjMatrix: mat4<f32>,
|
||||
renderTargetSize: vec2<f32>,
|
||||
invRenderTargetSize: vec2<f32>,
|
||||
eyePosition: vec3<f32>
|
||||
projectionMatrix: mat4[f32],
|
||||
invProjectionMatrix: mat4[f32],
|
||||
viewMatrix: mat4[f32],
|
||||
invViewMatrix: mat4[f32],
|
||||
viewProjMatrix: mat4[f32],
|
||||
invViewProjMatrix: mat4[f32],
|
||||
renderTargetSize: vec2[f32],
|
||||
invRenderTargetSize: vec2[f32],
|
||||
eyePosition: vec3[f32]
|
||||
}
|
||||
|
||||
external
|
||||
{
|
||||
[binding(0)] settings: uniform<MaterialSettings>,
|
||||
[binding(1)] MaterialDiffuseMap: sampler2D<f32>,
|
||||
[binding(2)] MaterialAlphaMap: sampler2D<f32>,
|
||||
[binding(3)] TextureOverlay: sampler2D<f32>,
|
||||
[binding(4)] instanceData: uniform<InstanceData>,
|
||||
[binding(5)] viewerData: uniform<ViewerData>,
|
||||
[binding(0)] settings: uniform[MaterialSettings],
|
||||
[binding(1)] MaterialDiffuseMap: sampler2D[f32],
|
||||
[binding(2)] MaterialAlphaMap: sampler2D[f32],
|
||||
[binding(3)] TextureOverlay: sampler2D[f32],
|
||||
[binding(4)] instanceData: uniform[InstanceData],
|
||||
[binding(5)] viewerData: uniform[ViewerData],
|
||||
}
|
||||
|
||||
// Fragment stage
|
||||
struct FragIn
|
||||
{
|
||||
[location(0), cond(HasUV)] uv: vec2<f32>,
|
||||
[location(1), cond(HasColor)] color: vec4<f32>
|
||||
[location(0), cond(HasUV)] uv: vec2[f32],
|
||||
[location(1), cond(HasColor)] color: vec4[f32]
|
||||
}
|
||||
|
||||
struct FragOut
|
||||
{
|
||||
[location(0)] RenderTarget0: vec4<f32>
|
||||
[location(0)] RenderTarget0: vec4[f32]
|
||||
}
|
||||
|
||||
[entry(frag)]
|
||||
@@ -99,29 +99,29 @@ fn main(input: FragIn) -> FragOut
|
||||
struct VertIn
|
||||
{
|
||||
[location(PosLocation)]
|
||||
pos: vec3<f32>,
|
||||
pos: vec3[f32],
|
||||
|
||||
[cond(HasVertexColor), location(ColorLocation)]
|
||||
color: vec4<f32>,
|
||||
color: vec4[f32],
|
||||
|
||||
[cond(HasUV), location(UvLocation)]
|
||||
uv: vec2<f32>,
|
||||
uv: vec2[f32],
|
||||
|
||||
[cond(Billboard), location(BillboardCenterLocation)]
|
||||
billboardCenter: vec3<f32>,
|
||||
billboardCenter: vec3[f32],
|
||||
|
||||
[cond(Billboard), location(BillboardSizeRotLocation)]
|
||||
billboardSizeRot: vec4<f32>, //< width,height,sin,cos
|
||||
billboardSizeRot: vec4[f32], //< width,height,sin,cos
|
||||
|
||||
[cond(Billboard), location(BillboardColorLocation)]
|
||||
billboardColor: vec4<f32>
|
||||
billboardColor: vec4[f32]
|
||||
}
|
||||
|
||||
struct VertOut
|
||||
{
|
||||
[location(0), cond(HasUV)] uv: vec2<f32>,
|
||||
[location(1), cond(HasColor)] color: vec4<f32>,
|
||||
[builtin(position)] position: vec4<f32>
|
||||
[location(0), cond(HasUV)] uv: vec2[f32],
|
||||
[location(1), cond(HasColor)] color: vec4[f32],
|
||||
[builtin(position)] position: vec4[f32]
|
||||
}
|
||||
|
||||
[entry(vert), cond(Billboard)]
|
||||
@@ -130,27 +130,27 @@ fn billboardMain(input: VertIn) -> VertOut
|
||||
let size = input.billboardSizeRot.xy;
|
||||
let sinCos = input.billboardSizeRot.zw;
|
||||
|
||||
let rotatedPosition = vec2<f32>(
|
||||
let rotatedPosition = vec2[f32](
|
||||
input.pos.x * sinCos.y - input.pos.y * sinCos.x,
|
||||
input.pos.y * sinCos.y + input.pos.x * sinCos.x
|
||||
);
|
||||
rotatedPosition *= size;
|
||||
|
||||
let cameraRight = vec3<f32>(viewerData.viewMatrix[0][0], viewerData.viewMatrix[1][0], viewerData.viewMatrix[2][0]);
|
||||
let cameraUp = vec3<f32>(viewerData.viewMatrix[0][1], viewerData.viewMatrix[1][1], viewerData.viewMatrix[2][1]);
|
||||
let cameraRight = vec3[f32](viewerData.viewMatrix[0][0], viewerData.viewMatrix[1][0], viewerData.viewMatrix[2][0]);
|
||||
let cameraUp = vec3[f32](viewerData.viewMatrix[0][1], viewerData.viewMatrix[1][1], viewerData.viewMatrix[2][1]);
|
||||
|
||||
let vertexPos = input.billboardCenter;
|
||||
vertexPos += cameraRight * rotatedPosition.x;
|
||||
vertexPos += cameraUp * rotatedPosition.y;
|
||||
|
||||
let output: VertOut;
|
||||
output.position = viewerData.viewProjMatrix * instanceData.worldMatrix * vec4<f32>(vertexPos, 1.0);
|
||||
output.position = viewerData.viewProjMatrix * instanceData.worldMatrix * vec4[f32](vertexPos, 1.0);
|
||||
|
||||
const if (HasColor)
|
||||
output.color = input.billboardColor;
|
||||
|
||||
const if (HasUV)
|
||||
output.uv = input.pos.xy + vec2<f32>(0.5, 0.5);
|
||||
output.uv = input.pos.xy + vec2[f32](0.5, 0.5);
|
||||
|
||||
return output;
|
||||
}
|
||||
@@ -159,7 +159,7 @@ fn billboardMain(input: VertIn) -> VertOut
|
||||
fn main(input: VertIn) -> VertOut
|
||||
{
|
||||
let output: VertOut;
|
||||
output.position = viewerData.viewProjMatrix * instanceData.worldMatrix * vec4<f32>(input.pos, 1.0);
|
||||
output.position = viewerData.viewProjMatrix * instanceData.worldMatrix * vec4[f32](input.pos, 1.0);
|
||||
|
||||
const if (HasColor)
|
||||
output.color = input.color;
|
||||
|
||||
@@ -1,25 +1,25 @@
|
||||
external
|
||||
{
|
||||
[binding(0)] texture: sampler2D<f32>
|
||||
[binding(0)] texture: sampler2D[f32]
|
||||
}
|
||||
|
||||
struct VertIn
|
||||
{
|
||||
[location(0)] position: vec2<f32>,
|
||||
[location(1)] uv: vec2<f32>
|
||||
[location(0)] position: vec2[f32],
|
||||
[location(1)] uv: vec2[f32]
|
||||
}
|
||||
|
||||
struct VertOut
|
||||
{
|
||||
[builtin(position)] position: vec4<f32>,
|
||||
[location(0)] uv: vec2<f32>
|
||||
[builtin(position)] position: vec4[f32],
|
||||
[location(0)] uv: vec2[f32]
|
||||
}
|
||||
|
||||
[entry(vert)]
|
||||
fn main(vertIn: VertIn) -> VertOut
|
||||
{
|
||||
let output: VertOut;
|
||||
output.position = vec4<f32>(vertIn.position, 0.0, 1.0);
|
||||
output.position = vec4[f32](vertIn.position, 0.0, 1.0);
|
||||
output.uv = vertIn.uv;
|
||||
|
||||
return output;
|
||||
@@ -27,7 +27,7 @@ fn main(vertIn: VertIn) -> VertOut
|
||||
|
||||
struct FragOut
|
||||
{
|
||||
[location(0)] color: vec4<f32>
|
||||
[location(0)] color: vec4[f32]
|
||||
}
|
||||
|
||||
[entry(frag)]
|
||||
|
||||
@@ -8,44 +8,44 @@ const HasUV = AlphaTest && (HasDiffuseTexture || HasAlphaTexture);
|
||||
struct BasicSettings
|
||||
{
|
||||
AlphaThreshold: f32,
|
||||
DiffuseColor: vec4<f32>
|
||||
DiffuseColor: vec4[f32]
|
||||
}
|
||||
|
||||
[layout(std140)]
|
||||
struct InstanceData
|
||||
{
|
||||
worldMatrix: mat4<f32>,
|
||||
invWorldMatrix: mat4<f32>
|
||||
worldMatrix: mat4[f32],
|
||||
invWorldMatrix: mat4[f32]
|
||||
}
|
||||
|
||||
[layout(std140)]
|
||||
struct ViewerData
|
||||
{
|
||||
projectionMatrix: mat4<f32>,
|
||||
invProjectionMatrix: mat4<f32>,
|
||||
viewMatrix: mat4<f32>,
|
||||
invViewMatrix: mat4<f32>,
|
||||
viewProjMatrix: mat4<f32>,
|
||||
invViewProjMatrix: mat4<f32>,
|
||||
renderTargetSize: vec2<f32>,
|
||||
invRenderTargetSize: vec2<f32>,
|
||||
eyePosition: vec3<f32>
|
||||
projectionMatrix: mat4[f32],
|
||||
invProjectionMatrix: mat4[f32],
|
||||
viewMatrix: mat4[f32],
|
||||
invViewMatrix: mat4[f32],
|
||||
viewProjMatrix: mat4[f32],
|
||||
invViewProjMatrix: mat4[f32],
|
||||
renderTargetSize: vec2[f32],
|
||||
invRenderTargetSize: vec2[f32],
|
||||
eyePosition: vec3[f32]
|
||||
}
|
||||
|
||||
external
|
||||
{
|
||||
[binding(0)] settings: uniform<BasicSettings>,
|
||||
[binding(1)] MaterialDiffuseMap: sampler2D<f32>,
|
||||
[binding(2)] MaterialAlphaMap: sampler2D<f32>,
|
||||
[binding(3)] TextureOverlay: sampler2D<f32>,
|
||||
[binding(4)] instanceData: uniform<InstanceData>,
|
||||
[binding(5)] viewerData: uniform<ViewerData>,
|
||||
[binding(0)] settings: uniform[BasicSettings],
|
||||
[binding(1)] MaterialDiffuseMap: sampler2D[f32],
|
||||
[binding(2)] MaterialAlphaMap: sampler2D[f32],
|
||||
[binding(3)] TextureOverlay: sampler2D[f32],
|
||||
[binding(4)] instanceData: uniform[InstanceData],
|
||||
[binding(5)] viewerData: uniform[ViewerData],
|
||||
}
|
||||
|
||||
// Fragment stage
|
||||
struct FragIn
|
||||
{
|
||||
[location(0), cond(HasUV)] uv: vec2<f32>
|
||||
[location(0), cond(HasUV)] uv: vec2[f32]
|
||||
}
|
||||
|
||||
[entry(frag), cond(AlphaTest)]
|
||||
@@ -73,21 +73,21 @@ fn main() {}
|
||||
// Vertex stage
|
||||
struct VertIn
|
||||
{
|
||||
[location(0)] pos: vec3<f32>,
|
||||
[location(1), cond(HasUV)] uv: vec2<f32>
|
||||
[location(0)] pos: vec3[f32],
|
||||
[location(1), cond(HasUV)] uv: vec2[f32]
|
||||
}
|
||||
|
||||
struct VertOut
|
||||
{
|
||||
[location(0), cond(HasUV)] uv: vec2<f32>,
|
||||
[builtin(position)] position: vec4<f32>
|
||||
[location(0), cond(HasUV)] uv: vec2[f32],
|
||||
[builtin(position)] position: vec4[f32]
|
||||
}
|
||||
|
||||
[entry(vert)]
|
||||
fn main(input: VertIn) -> VertOut
|
||||
{
|
||||
let output: VertOut;
|
||||
output.position = viewerData.viewProjMatrix * instanceData.worldMatrix * vec4<f32>(input.pos, 1.0);
|
||||
output.position = viewerData.viewProjMatrix * instanceData.worldMatrix * vec4[f32](input.pos, 1.0);
|
||||
|
||||
const if (HasUV)
|
||||
output.uv = input.uv;
|
||||
|
||||
@@ -36,19 +36,19 @@ struct MaterialSettings
|
||||
{
|
||||
// BasicSettings
|
||||
AlphaThreshold: f32,
|
||||
DiffuseColor: vec4<f32>,
|
||||
DiffuseColor: vec4[f32],
|
||||
|
||||
// PhongSettings
|
||||
AmbientColor: vec3<f32>,
|
||||
SpecularColor: vec3<f32>,
|
||||
AmbientColor: vec3[f32],
|
||||
SpecularColor: vec3[f32],
|
||||
Shininess: f32,
|
||||
}
|
||||
|
||||
[layout(std140)]
|
||||
struct InstanceData
|
||||
{
|
||||
worldMatrix: mat4<f32>,
|
||||
invWorldMatrix: mat4<f32>
|
||||
worldMatrix: mat4[f32],
|
||||
invWorldMatrix: mat4[f32]
|
||||
}
|
||||
|
||||
// TODO: Add enums
|
||||
@@ -60,64 +60,64 @@ const SpotLight = 2;
|
||||
struct Light
|
||||
{
|
||||
type: i32,
|
||||
color: vec4<f32>,
|
||||
factor: vec2<f32>,
|
||||
parameter1: vec4<f32>,
|
||||
parameter2: vec4<f32>,
|
||||
parameter3: vec4<f32>,
|
||||
hasShadowMapping: bool
|
||||
color: vec4[f32],
|
||||
factor: vec2[f32],
|
||||
parameter1: vec4[f32],
|
||||
parameter2: vec4[f32],
|
||||
parameter3: vec4[f32],
|
||||
hasShadowMapping: u32
|
||||
}
|
||||
|
||||
[layout(std140)]
|
||||
struct LightData
|
||||
{
|
||||
lights: [Light; MaxLightCount],
|
||||
lightCount: u32,
|
||||
lights: array[Light, MaxLightCount],
|
||||
lightCount: u32
|
||||
}
|
||||
|
||||
[layout(std140)]
|
||||
struct ViewerData
|
||||
{
|
||||
projectionMatrix: mat4<f32>,
|
||||
invProjectionMatrix: mat4<f32>,
|
||||
viewMatrix: mat4<f32>,
|
||||
invViewMatrix: mat4<f32>,
|
||||
viewProjMatrix: mat4<f32>,
|
||||
invViewProjMatrix: mat4<f32>,
|
||||
renderTargetSize: vec2<f32>,
|
||||
invRenderTargetSize: vec2<f32>,
|
||||
eyePosition: vec3<f32>
|
||||
projectionMatrix: mat4[f32],
|
||||
invProjectionMatrix: mat4[f32],
|
||||
viewMatrix: mat4[f32],
|
||||
invViewMatrix: mat4[f32],
|
||||
viewProjMatrix: mat4[f32],
|
||||
invViewProjMatrix: mat4[f32],
|
||||
renderTargetSize: vec2[f32],
|
||||
invRenderTargetSize: vec2[f32],
|
||||
eyePosition: vec3[f32]
|
||||
}
|
||||
|
||||
external
|
||||
{
|
||||
[binding(0)] settings: uniform<MaterialSettings>,
|
||||
[binding(1)] MaterialDiffuseMap: sampler2D<f32>,
|
||||
[binding(2)] MaterialAlphaMap: sampler2D<f32>,
|
||||
[binding(3)] TextureOverlay: sampler2D<f32>,
|
||||
[binding(4)] instanceData: uniform<InstanceData>,
|
||||
[binding(5)] viewerData: uniform<ViewerData>,
|
||||
[binding(6)] lightData: uniform<LightData>,
|
||||
[binding(7)] MaterialEmissiveMap: sampler2D<f32>,
|
||||
[binding(8)] MaterialHeightMap: sampler2D<f32>,
|
||||
[binding(9)] MaterialNormalMap: sampler2D<f32>,
|
||||
[binding(10)] MaterialSpecularMap: sampler2D<f32>,
|
||||
[binding(0)] settings: uniform[MaterialSettings],
|
||||
[binding(1)] MaterialDiffuseMap: sampler2D[f32],
|
||||
[binding(2)] MaterialAlphaMap: sampler2D[f32],
|
||||
[binding(3)] TextureOverlay: sampler2D[f32],
|
||||
[binding(4)] instanceData: uniform[InstanceData],
|
||||
[binding(5)] viewerData: uniform[ViewerData],
|
||||
[binding(6)] lightData: uniform[LightData],
|
||||
[binding(7)] MaterialEmissiveMap: sampler2D[f32],
|
||||
[binding(8)] MaterialHeightMap: sampler2D[f32],
|
||||
[binding(9)] MaterialNormalMap: sampler2D[f32],
|
||||
[binding(10)] MaterialSpecularMap: sampler2D[f32],
|
||||
}
|
||||
|
||||
struct VertToFrag
|
||||
{
|
||||
[location(0)] worldPos: vec3<f32>,
|
||||
[location(1), cond(HasUV)] uv: vec2<f32>,
|
||||
[location(2), cond(HasColor)] color: vec4<f32>,
|
||||
[location(3), cond(HasNormal)] normal: vec3<f32>,
|
||||
[location(4), cond(HasNormalMapping)] tbnMatrix: mat3<f32>,
|
||||
[builtin(position)] position: vec4<f32>,
|
||||
[location(0)] worldPos: vec3[f32],
|
||||
[location(1), cond(HasUV)] uv: vec2[f32],
|
||||
[location(2), cond(HasColor)] color: vec4[f32],
|
||||
[location(3), cond(HasNormal)] normal: vec3[f32],
|
||||
[location(4), cond(HasNormalMapping)] tbnMatrix: mat3[f32],
|
||||
[builtin(position)] position: vec4[f32],
|
||||
}
|
||||
|
||||
// Fragment stage
|
||||
struct FragOut
|
||||
{
|
||||
[location(0)] RenderTarget0: vec4<f32>
|
||||
[location(0)] RenderTarget0: vec4[f32]
|
||||
}
|
||||
|
||||
[entry(frag)]
|
||||
@@ -145,15 +145,15 @@ fn main(input: VertToFrag) -> FragOut
|
||||
|
||||
const if (HasNormal)
|
||||
{
|
||||
let lightAmbient = vec3<f32>(0.0, 0.0, 0.0);
|
||||
let lightDiffuse = vec3<f32>(0.0, 0.0, 0.0);
|
||||
let lightSpecular = vec3<f32>(0.0, 0.0, 0.0);
|
||||
let lightAmbient = vec3[f32](0.0, 0.0, 0.0);
|
||||
let lightDiffuse = vec3[f32](0.0, 0.0, 0.0);
|
||||
let lightSpecular = vec3[f32](0.0, 0.0, 0.0);
|
||||
|
||||
let eyeVec = normalize(viewerData.eyePosition - input.worldPos);
|
||||
|
||||
let normal: vec3<f32>;
|
||||
let normal: vec3[f32];
|
||||
const if (HasNormalMapping)
|
||||
normal = normalize(input.tbnMatrix * (MaterialNormalMap.Sample(input.uv).xyz * 2.0 - vec3<f32>(1.0, 1.0, 1.0)));
|
||||
normal = normalize(input.tbnMatrix * (MaterialNormalMap.Sample(input.uv).xyz * 2.0 - vec3[f32](1.0, 1.0, 1.0)));
|
||||
else
|
||||
normal = normalize(input.normal);
|
||||
|
||||
@@ -244,7 +244,7 @@ fn main(input: VertToFrag) -> FragOut
|
||||
let lightColor = lightAmbient + lightDiffuse + lightSpecular;
|
||||
|
||||
let output: FragOut;
|
||||
output.RenderTarget0 = vec4<f32>(lightColor, 1.0) * diffuseColor;
|
||||
output.RenderTarget0 = vec4[f32](lightColor, 1.0) * diffuseColor;
|
||||
return output;
|
||||
}
|
||||
else
|
||||
@@ -259,28 +259,28 @@ fn main(input: VertToFrag) -> FragOut
|
||||
struct VertIn
|
||||
{
|
||||
[location(PosLocation)]
|
||||
pos: vec3<f32>,
|
||||
pos: vec3[f32],
|
||||
|
||||
[cond(HasVertexColor), location(ColorLocation)]
|
||||
color: vec4<f32>,
|
||||
color: vec4[f32],
|
||||
|
||||
[cond(HasUV), location(UvLocation)]
|
||||
uv: vec2<f32>,
|
||||
uv: vec2[f32],
|
||||
|
||||
[cond(HasNormal), location(NormalLocation)]
|
||||
normal: vec3<f32>,
|
||||
normal: vec3[f32],
|
||||
|
||||
[cond(HasTangent), location(TangentLocation)]
|
||||
tangent: vec3<f32>,
|
||||
tangent: vec3[f32],
|
||||
|
||||
[cond(Billboard), location(BillboardCenterLocation)]
|
||||
billboardCenter: vec3<f32>,
|
||||
billboardCenter: vec3[f32],
|
||||
|
||||
[cond(Billboard), location(BillboardSizeRotLocation)]
|
||||
billboardSizeRot: vec4<f32>, //< width,height,sin,cos
|
||||
billboardSizeRot: vec4[f32], //< width,height,sin,cos
|
||||
|
||||
[cond(Billboard), location(BillboardColorLocation)]
|
||||
billboardColor: vec4<f32>
|
||||
billboardColor: vec4[f32]
|
||||
}
|
||||
|
||||
[entry(vert), cond(Billboard)]
|
||||
@@ -289,27 +289,27 @@ fn billboardMain(input: VertIn) -> VertOut
|
||||
let size = input.billboardSizeRot.xy;
|
||||
let sinCos = input.billboardSizeRot.zw;
|
||||
|
||||
let rotatedPosition = vec2<f32>(
|
||||
let rotatedPosition = vec2[f32](
|
||||
input.pos.x * sinCos.y - input.pos.y * sinCos.x,
|
||||
input.pos.y * sinCos.y + input.pos.x * sinCos.x
|
||||
);
|
||||
rotatedPosition *= size;
|
||||
|
||||
let cameraRight = vec3<f32>(viewerData.viewMatrix[0][0], viewerData.viewMatrix[1][0], viewerData.viewMatrix[2][0]);
|
||||
let cameraUp = vec3<f32>(viewerData.viewMatrix[0][1], viewerData.viewMatrix[1][1], viewerData.viewMatrix[2][1]);
|
||||
let cameraRight = vec3[f32](viewerData.viewMatrix[0][0], viewerData.viewMatrix[1][0], viewerData.viewMatrix[2][0]);
|
||||
let cameraUp = vec3[f32](viewerData.viewMatrix[0][1], viewerData.viewMatrix[1][1], viewerData.viewMatrix[2][1]);
|
||||
|
||||
let vertexPos = input.billboardCenter;
|
||||
vertexPos += cameraRight * rotatedPosition.x;
|
||||
vertexPos += cameraUp * rotatedPosition.y;
|
||||
|
||||
let output: VertToFrag;
|
||||
output.position = viewerData.viewProjMatrix * instanceData.worldMatrix * vec4<f32>(vertexPos, 1.0);
|
||||
output.position = viewerData.viewProjMatrix * instanceData.worldMatrix * vec4[f32](vertexPos, 1.0);
|
||||
|
||||
const if (HasColor)
|
||||
output.color = input.billboardColor;
|
||||
|
||||
const if (HasUV)
|
||||
output.uv = input.pos.xy + vec2<f32>(0.5, 0.5);
|
||||
output.uv = input.pos.xy + vec2[f32](0.5, 0.5);
|
||||
|
||||
return output;
|
||||
}
|
||||
@@ -317,13 +317,13 @@ fn billboardMain(input: VertIn) -> VertOut
|
||||
[entry(vert), cond(!Billboard)]
|
||||
fn main(input: VertIn) -> VertToFrag
|
||||
{
|
||||
let worldPosition = instanceData.worldMatrix * vec4<f32>(input.pos, 1.0);
|
||||
let worldPosition = instanceData.worldMatrix * vec4[f32](input.pos, 1.0);
|
||||
|
||||
let output: VertToFrag;
|
||||
output.worldPos = worldPosition.xyz;
|
||||
output.position = viewerData.viewProjMatrix * worldPosition;
|
||||
|
||||
let rotationMatrix = mat3<f32>(instanceData.worldMatrix);
|
||||
let rotationMatrix = mat3[f32](instanceData.worldMatrix);
|
||||
|
||||
const if (HasColor)
|
||||
output.color = input.color;
|
||||
|
||||
Reference in New Issue
Block a user