mirror of https://github.com/sotrh/learn-wgpu
finished code migration
parent
88df0ff823
commit
fd589adbe1
Binary file not shown.
@ -0,0 +1,20 @@
|
||||
struct FragmentOutput {
|
||||
[[location(0)]] f_color: vec4<f32>;
|
||||
};
|
||||
|
||||
var<private> v_color1: vec3<f32>;
|
||||
var<private> f_color: vec4<f32>;
|
||||
|
||||
fn main1() {
|
||||
let _e2: vec3<f32> = v_color1;
|
||||
f_color = vec4<f32>(_e2, 1.0);
|
||||
return;
|
||||
}
|
||||
|
||||
[[stage(fragment)]]
|
||||
fn main([[location(0)]] v_color: vec3<f32>) -> FragmentOutput {
|
||||
v_color1 = v_color;
|
||||
main1();
|
||||
let _e7: vec4<f32> = f_color;
|
||||
return FragmentOutput(_e7);
|
||||
}
|
Binary file not shown.
@ -0,0 +1,49 @@
|
||||
[[block]]
|
||||
struct Camera {
|
||||
u_view_position: vec3<f32>;
|
||||
u_view_proj: mat4x4<f32>;
|
||||
};
|
||||
|
||||
[[block]]
|
||||
struct Light {
|
||||
u_position: vec3<f32>;
|
||||
u_color: vec3<f32>;
|
||||
};
|
||||
|
||||
struct VertexOutput {
|
||||
[[location(0)]] v_color: vec3<f32>;
|
||||
[[builtin(position)]] member: vec4<f32>;
|
||||
};
|
||||
|
||||
var<private> a_position1: vec3<f32>;
|
||||
var<private> v_color: vec3<f32>;
|
||||
[[group(0), binding(0)]]
|
||||
var<uniform> global: Camera;
|
||||
[[group(1), binding(0)]]
|
||||
var<uniform> global1: Light;
|
||||
var<private> scale: f32 = 0.25;
|
||||
var<private> gl_Position: vec4<f32>;
|
||||
|
||||
fn main1() {
|
||||
var v_position: vec3<f32>;
|
||||
|
||||
let _e11: vec3<f32> = a_position1;
|
||||
let _e12: f32 = scale;
|
||||
let _e14: vec3<f32> = global1.u_position;
|
||||
v_position = ((_e11 * _e12) + _e14);
|
||||
let _e18: mat4x4<f32> = global.u_view_proj;
|
||||
let _e19: vec3<f32> = v_position;
|
||||
gl_Position = (_e18 * vec4<f32>(_e19, f32(1)));
|
||||
let _e24: vec3<f32> = global1.u_color;
|
||||
v_color = _e24;
|
||||
return;
|
||||
}
|
||||
|
||||
[[stage(vertex)]]
|
||||
fn main([[location(0)]] a_position: vec3<f32>) -> VertexOutput {
|
||||
a_position1 = a_position;
|
||||
main1();
|
||||
let _e18: vec3<f32> = v_color;
|
||||
let _e20: vec4<f32> = gl_Position;
|
||||
return VertexOutput(_e18, _e20);
|
||||
}
|
Binary file not shown.
@ -0,0 +1,252 @@
|
||||
struct ModelVertex {
|
||||
x: f32;
|
||||
y: f32;
|
||||
z: f32;
|
||||
uv: f32;
|
||||
uw: f32;
|
||||
nx: f32;
|
||||
ny: f32;
|
||||
nz: f32;
|
||||
tx: f32;
|
||||
ty: f32;
|
||||
tz: f32;
|
||||
bx: f32;
|
||||
by: f32;
|
||||
bz: f32;
|
||||
pad0_: u32;
|
||||
pad1_: u32;
|
||||
};
|
||||
|
||||
[[block]]
|
||||
struct SrcVertexBuffer {
|
||||
srcVertices: [[stride(64)]] array<ModelVertex>;
|
||||
};
|
||||
|
||||
[[block]]
|
||||
struct DstVertexBuffer {
|
||||
dstVertices: [[stride(64)]] array<ModelVertex>;
|
||||
};
|
||||
|
||||
[[block]]
|
||||
struct IndexBuffer {
|
||||
indices: [[stride(4)]] array<u32>;
|
||||
};
|
||||
|
||||
[[block]]
|
||||
struct ComputeInfo {
|
||||
numVertices: u32;
|
||||
numIndices: u32;
|
||||
};
|
||||
|
||||
[[group(0), binding(0)]]
|
||||
var<storage> global: SrcVertexBuffer;
|
||||
[[group(0), binding(1)]]
|
||||
var<storage, read_write> global1: DstVertexBuffer;
|
||||
[[group(0), binding(2)]]
|
||||
var<storage> global2: IndexBuffer;
|
||||
[[group(0), binding(3)]]
|
||||
var<uniform> global3: ComputeInfo;
|
||||
var<private> gl_GlobalInvocationID: vec3<u32>;
|
||||
|
||||
fn getPos(v: ModelVertex) -> vec3<f32> {
|
||||
var v1: ModelVertex;
|
||||
|
||||
v1 = v;
|
||||
let _e12: ModelVertex = v1;
|
||||
let _e14: ModelVertex = v1;
|
||||
let _e16: ModelVertex = v1;
|
||||
return vec3<f32>(_e12.x, _e14.y, _e16.z);
|
||||
}
|
||||
|
||||
fn getUV(v2: ModelVertex) -> vec2<f32> {
|
||||
var v3: ModelVertex;
|
||||
|
||||
v3 = v2;
|
||||
let _e12: ModelVertex = v3;
|
||||
let _e14: ModelVertex = v3;
|
||||
return vec2<f32>(_e12.uv, _e14.uw);
|
||||
}
|
||||
|
||||
fn getNormal(v4: ModelVertex) -> vec3<f32> {
|
||||
var v5: ModelVertex;
|
||||
|
||||
v5 = v4;
|
||||
let _e12: ModelVertex = v5;
|
||||
let _e14: ModelVertex = v5;
|
||||
let _e16: ModelVertex = v5;
|
||||
return vec3<f32>(_e12.nx, _e14.ny, _e16.nz);
|
||||
}
|
||||
|
||||
fn calcTangentBitangent(vertexIndex: u32) -> ModelVertex {
|
||||
var vertexIndex1: u32;
|
||||
var v6: ModelVertex;
|
||||
var tangent: vec3<f32> = vec3<f32>(0.0, 0.0, 0.0);
|
||||
var bitangent: vec3<f32> = vec3<f32>(0.0, 0.0, 0.0);
|
||||
var trianglesIncluded: u32 = 0u;
|
||||
var i: u32 = 0u;
|
||||
var index0_: u32;
|
||||
var index1_: u32;
|
||||
var index2_: u32;
|
||||
var v0_: ModelVertex;
|
||||
var v1_: ModelVertex;
|
||||
var v2_: ModelVertex;
|
||||
var pos0_: vec3<f32>;
|
||||
var pos1_: vec3<f32>;
|
||||
var pos2_: vec3<f32>;
|
||||
var uv0_: vec2<f32>;
|
||||
var uv1_: vec2<f32>;
|
||||
var uv2_: vec2<f32>;
|
||||
var delta_pos1_: vec3<f32>;
|
||||
var delta_pos2_: vec3<f32>;
|
||||
var delta_uv1_: vec2<f32>;
|
||||
var delta_uv2_: vec2<f32>;
|
||||
var r: f32;
|
||||
|
||||
vertexIndex1 = vertexIndex;
|
||||
let _e12: u32 = vertexIndex1;
|
||||
let _e14: ModelVertex = global.srcVertices[_e12];
|
||||
v6 = _e14;
|
||||
loop {
|
||||
let _e30: u32 = i;
|
||||
let _e31: u32 = global3.numIndices;
|
||||
if (!((_e30 < _e31))) {
|
||||
break;
|
||||
}
|
||||
{
|
||||
let _e38: u32 = i;
|
||||
let _e40: u32 = global2.indices[_e38];
|
||||
index0_ = _e40;
|
||||
let _e42: u32 = i;
|
||||
let _e47: u32 = global2.indices[(_e42 + u32(1))];
|
||||
index1_ = _e47;
|
||||
let _e49: u32 = i;
|
||||
let _e54: u32 = global2.indices[(_e49 + u32(2))];
|
||||
index2_ = _e54;
|
||||
let _e56: u32 = index0_;
|
||||
let _e57: u32 = vertexIndex1;
|
||||
let _e59: u32 = index1_;
|
||||
let _e60: u32 = vertexIndex1;
|
||||
let _e63: u32 = index2_;
|
||||
let _e64: u32 = vertexIndex1;
|
||||
if ((((_e56 == _e57) || (_e59 == _e60)) || (_e63 == _e64))) {
|
||||
{
|
||||
let _e67: u32 = index0_;
|
||||
let _e69: ModelVertex = global.srcVertices[_e67];
|
||||
v0_ = _e69;
|
||||
let _e71: u32 = index1_;
|
||||
let _e73: ModelVertex = global.srcVertices[_e71];
|
||||
v1_ = _e73;
|
||||
let _e75: u32 = index2_;
|
||||
let _e77: ModelVertex = global.srcVertices[_e75];
|
||||
v2_ = _e77;
|
||||
let _e80: ModelVertex = v0_;
|
||||
let _e81: vec3<f32> = getPos(_e80);
|
||||
pos0_ = _e81;
|
||||
let _e84: ModelVertex = v1_;
|
||||
let _e85: vec3<f32> = getPos(_e84);
|
||||
pos1_ = _e85;
|
||||
let _e88: ModelVertex = v2_;
|
||||
let _e89: vec3<f32> = getPos(_e88);
|
||||
pos2_ = _e89;
|
||||
let _e92: ModelVertex = v0_;
|
||||
let _e93: vec2<f32> = getUV(_e92);
|
||||
uv0_ = _e93;
|
||||
let _e96: ModelVertex = v1_;
|
||||
let _e97: vec2<f32> = getUV(_e96);
|
||||
uv1_ = _e97;
|
||||
let _e100: ModelVertex = v2_;
|
||||
let _e101: vec2<f32> = getUV(_e100);
|
||||
uv2_ = _e101;
|
||||
let _e103: vec3<f32> = pos1_;
|
||||
let _e104: vec3<f32> = pos0_;
|
||||
delta_pos1_ = (_e103 - _e104);
|
||||
let _e107: vec3<f32> = pos2_;
|
||||
let _e108: vec3<f32> = pos0_;
|
||||
delta_pos2_ = (_e107 - _e108);
|
||||
let _e111: vec2<f32> = uv1_;
|
||||
let _e112: vec2<f32> = uv0_;
|
||||
delta_uv1_ = (_e111 - _e112);
|
||||
let _e115: vec2<f32> = uv2_;
|
||||
let _e116: vec2<f32> = uv0_;
|
||||
delta_uv2_ = (_e115 - _e116);
|
||||
let _e120: vec2<f32> = delta_uv1_;
|
||||
let _e122: vec2<f32> = delta_uv2_;
|
||||
let _e125: vec2<f32> = delta_uv1_;
|
||||
let _e127: vec2<f32> = delta_uv2_;
|
||||
r = (1.0 / ((_e120.x * _e122.y) - (_e125.y * _e127.x)));
|
||||
let _e133: vec3<f32> = tangent;
|
||||
let _e134: vec3<f32> = delta_pos1_;
|
||||
let _e135: vec2<f32> = delta_uv2_;
|
||||
let _e138: vec3<f32> = delta_pos2_;
|
||||
let _e139: vec2<f32> = delta_uv1_;
|
||||
let _e143: f32 = r;
|
||||
tangent = (_e133 + (((_e134 * _e135.y) - (_e138 * _e139.y)) * _e143));
|
||||
let _e146: vec3<f32> = bitangent;
|
||||
let _e147: vec3<f32> = delta_pos2_;
|
||||
let _e148: vec2<f32> = delta_uv1_;
|
||||
let _e151: vec3<f32> = delta_pos1_;
|
||||
let _e152: vec2<f32> = delta_uv2_;
|
||||
let _e156: f32 = r;
|
||||
bitangent = (_e146 + (((_e147 * _e148.x) - (_e151 * _e152.x)) * _e156));
|
||||
let _e159: u32 = trianglesIncluded;
|
||||
trianglesIncluded = (_e159 + u32(1));
|
||||
}
|
||||
}
|
||||
}
|
||||
continuing {
|
||||
let _e34: u32 = i;
|
||||
i = (_e34 + u32(3));
|
||||
}
|
||||
}
|
||||
let _e163: u32 = trianglesIncluded;
|
||||
if ((_e163 > u32(0))) {
|
||||
{
|
||||
let _e167: vec3<f32> = tangent;
|
||||
let _e168: u32 = trianglesIncluded;
|
||||
tangent = (_e167 / vec3<f32>(f32(_e168)));
|
||||
let _e172: vec3<f32> = bitangent;
|
||||
let _e173: u32 = trianglesIncluded;
|
||||
bitangent = (_e172 / vec3<f32>(f32(_e173)));
|
||||
let _e178: vec3<f32> = tangent;
|
||||
tangent = normalize(_e178);
|
||||
let _e181: vec3<f32> = bitangent;
|
||||
bitangent = normalize(_e181);
|
||||
}
|
||||
}
|
||||
let _e184: vec3<f32> = tangent;
|
||||
v6.tx = _e184.x;
|
||||
let _e187: vec3<f32> = tangent;
|
||||
v6.ty = _e187.y;
|
||||
let _e190: vec3<f32> = tangent;
|
||||
v6.tz = _e190.z;
|
||||
let _e193: vec3<f32> = bitangent;
|
||||
v6.bx = _e193.x;
|
||||
let _e196: vec3<f32> = bitangent;
|
||||
v6.by = _e196.y;
|
||||
let _e199: vec3<f32> = bitangent;
|
||||
v6.bz = _e199.z;
|
||||
let _e201: ModelVertex = v6;
|
||||
return _e201;
|
||||
}
|
||||
|
||||
fn main1() {
|
||||
var vertexIndex2: u32;
|
||||
var result: ModelVertex;
|
||||
|
||||
let _e11: vec3<u32> = gl_GlobalInvocationID;
|
||||
vertexIndex2 = _e11.x;
|
||||
let _e15: u32 = vertexIndex2;
|
||||
let _e16: ModelVertex = calcTangentBitangent(_e15);
|
||||
result = _e16;
|
||||
let _e18: u32 = vertexIndex2;
|
||||
let _e20: ModelVertex = result;
|
||||
global1.dstVertices[_e18] = _e20;
|
||||
return;
|
||||
}
|
||||
|
||||
[[stage(compute), workgroup_size(64, 1, 1)]]
|
||||
fn main([[builtin(global_invocation_id)]] param: vec3<u32>) {
|
||||
gl_GlobalInvocationID = param;
|
||||
main1();
|
||||
return;
|
||||
}
|
Binary file not shown.
@ -0,0 +1,109 @@
|
||||
[[block]]
|
||||
struct Light {
|
||||
light_position: vec3<f32>;
|
||||
light_color: vec3<f32>;
|
||||
};
|
||||
|
||||
struct FragmentOutput {
|
||||
[[location(0)]] f_color: vec4<f32>;
|
||||
};
|
||||
|
||||
var<private> v_tex_coords1: vec2<f32>;
|
||||
var<private> v_position1: vec3<f32>;
|
||||
var<private> v_light_position1: vec3<f32>;
|
||||
var<private> v_view_position1: vec3<f32>;
|
||||
var<private> f_color: vec4<f32>;
|
||||
[[group(0), binding(0)]]
|
||||
var t_diffuse: texture_2d<f32>;
|
||||
[[group(0), binding(1)]]
|
||||
var s_diffuse: sampler;
|
||||
[[group(0), binding(2)]]
|
||||
var t_normal: texture_2d<f32>;
|
||||
[[group(0), binding(3)]]
|
||||
var s_normal: sampler;
|
||||
[[group(2), binding(0)]]
|
||||
var<uniform> global: Light;
|
||||
|
||||
fn main1() {
|
||||
var object_color: vec4<f32>;
|
||||
var object_normal: vec4<f32>;
|
||||
var ambient_strength: f32 = 0.10000000149011612;
|
||||
var ambient_color: vec3<f32>;
|
||||
var normal: vec3<f32>;
|
||||
var light_dir: vec3<f32>;
|
||||
var diffuse_strength: f32;
|
||||
var diffuse_color: vec3<f32>;
|
||||
var view_dir: vec3<f32>;
|
||||
var half_dir: vec3<f32>;
|
||||
var specular_strength: f32;
|
||||
var specular_color: vec3<f32>;
|
||||
var result: vec3<f32>;
|
||||
|
||||
let _e14: vec2<f32> = v_tex_coords1;
|
||||
let _e15: vec4<f32> = textureSample(t_diffuse, s_diffuse, _e14);
|
||||
object_color = _e15;
|
||||
let _e18: vec2<f32> = v_tex_coords1;
|
||||
let _e19: vec4<f32> = textureSample(t_normal, s_normal, _e18);
|
||||
object_normal = _e19;
|
||||
let _e23: vec3<f32> = global.light_color;
|
||||
let _e24: f32 = ambient_strength;
|
||||
ambient_color = (_e23 * _e24);
|
||||
let _e27: vec4<f32> = object_normal;
|
||||
let _e34: vec4<f32> = object_normal;
|
||||
normal = normalize(((_e34.xyz * 2.0) - vec3<f32>(1.0)));
|
||||
let _e43: vec3<f32> = v_light_position1;
|
||||
let _e44: vec3<f32> = v_position1;
|
||||
let _e46: vec3<f32> = v_light_position1;
|
||||
let _e47: vec3<f32> = v_position1;
|
||||
light_dir = normalize((_e46 - _e47));
|
||||
let _e53: vec3<f32> = normal;
|
||||
let _e54: vec3<f32> = light_dir;
|
||||
let _e59: vec3<f32> = normal;
|
||||
let _e60: vec3<f32> = light_dir;
|
||||
diffuse_strength = max(dot(_e59, _e60), 0.0);
|
||||
let _e65: vec3<f32> = global.light_color;
|
||||
let _e66: f32 = diffuse_strength;
|
||||
diffuse_color = (_e65 * _e66);
|
||||
let _e69: vec3<f32> = v_view_position1;
|
||||
let _e70: vec3<f32> = v_position1;
|
||||
let _e72: vec3<f32> = v_view_position1;
|
||||
let _e73: vec3<f32> = v_position1;
|
||||
view_dir = normalize((_e72 - _e73));
|
||||
let _e77: vec3<f32> = view_dir;
|
||||
let _e78: vec3<f32> = light_dir;
|
||||
let _e80: vec3<f32> = view_dir;
|
||||
let _e81: vec3<f32> = light_dir;
|
||||
half_dir = normalize((_e80 + _e81));
|
||||
let _e87: vec3<f32> = normal;
|
||||
let _e88: vec3<f32> = half_dir;
|
||||
let _e93: vec3<f32> = normal;
|
||||
let _e94: vec3<f32> = half_dir;
|
||||
let _e101: vec3<f32> = normal;
|
||||
let _e102: vec3<f32> = half_dir;
|
||||
let _e107: vec3<f32> = normal;
|
||||
let _e108: vec3<f32> = half_dir;
|
||||
specular_strength = pow(max(dot(_e107, _e108), 0.0), f32(32));
|
||||
let _e116: f32 = specular_strength;
|
||||
let _e117: vec3<f32> = global.light_color;
|
||||
specular_color = (_e116 * _e117);
|
||||
let _e120: vec3<f32> = ambient_color;
|
||||
let _e121: vec3<f32> = diffuse_color;
|
||||
let _e123: vec3<f32> = specular_color;
|
||||
let _e125: vec4<f32> = object_color;
|
||||
result = (((_e120 + _e121) + _e123) * _e125.xyz);
|
||||
let _e129: vec3<f32> = result;
|
||||
let _e130: vec4<f32> = object_color;
|
||||
f_color = vec4<f32>(_e129, _e130.w);
|
||||
return;
|
||||
}
|
||||
|
||||
[[stage(fragment)]]
|
||||
fn main([[location(0)]] v_tex_coords: vec2<f32>, [[location(1)]] v_position: vec3<f32>, [[location(2)]] v_light_position: vec3<f32>, [[location(3)]] v_view_position: vec3<f32>) -> FragmentOutput {
|
||||
v_tex_coords1 = v_tex_coords;
|
||||
v_position1 = v_position;
|
||||
v_light_position1 = v_light_position;
|
||||
v_view_position1 = v_view_position;
|
||||
main1();
|
||||
let _e31: vec4<f32> = f_color;
|
||||
return FragmentOutput(_e31);
|
||||
}
|
Binary file not shown.
@ -0,0 +1,124 @@
|
||||
[[block]]
|
||||
struct Camera {
|
||||
u_view_position: vec3<f32>;
|
||||
u_view_proj: mat4x4<f32>;
|
||||
};
|
||||
|
||||
[[block]]
|
||||
struct Light {
|
||||
light_position: vec3<f32>;
|
||||
light_color: vec3<f32>;
|
||||
};
|
||||
|
||||
struct VertexOutput {
|
||||
[[location(0)]] v_tex_coords: vec2<f32>;
|
||||
[[location(1)]] v_position: vec3<f32>;
|
||||
[[location(2)]] v_light_position: vec3<f32>;
|
||||
[[location(3)]] v_view_position: vec3<f32>;
|
||||
[[builtin(position)]] member: vec4<f32>;
|
||||
};
|
||||
|
||||
var<private> a_position1: vec3<f32>;
|
||||
var<private> a_tex_coords1: vec2<f32>;
|
||||
var<private> a_normal1: vec3<f32>;
|
||||
var<private> a_tangent1: vec3<f32>;
|
||||
var<private> a_bitangent1: vec3<f32>;
|
||||
var<private> v_tex_coords: vec2<f32>;
|
||||
var<private> v_position: vec3<f32>;
|
||||
var<private> v_light_position: vec3<f32>;
|
||||
var<private> v_view_position: vec3<f32>;
|
||||
[[group(1), binding(0)]]
|
||||
var<uniform> global: Camera;
|
||||
var<private> model_matrix_0_1: vec4<f32>;
|
||||
var<private> model_matrix_1_1: vec4<f32>;
|
||||
var<private> model_matrix_2_1: vec4<f32>;
|
||||
var<private> model_matrix_3_1: vec4<f32>;
|
||||
var<private> normal_matrix_0_1: vec3<f32>;
|
||||
var<private> normal_matrix_1_1: vec3<f32>;
|
||||
var<private> normal_matrix_2_1: vec3<f32>;
|
||||
[[group(2), binding(0)]]
|
||||
var<uniform> global1: Light;
|
||||
var<private> gl_Position: vec4<f32>;
|
||||
|
||||
fn main1() {
|
||||
var model_matrix: mat4x4<f32>;
|
||||
var normal_matrix: mat3x3<f32>;
|
||||
var normal: vec3<f32>;
|
||||
var tangent: vec3<f32>;
|
||||
var bitangent: vec3<f32>;
|
||||
var tangent_matrix: mat3x3<f32>;
|
||||
var model_space: vec4<f32>;
|
||||
|
||||
let _e24: vec4<f32> = model_matrix_0_1;
|
||||
let _e25: vec4<f32> = model_matrix_1_1;
|
||||
let _e26: vec4<f32> = model_matrix_2_1;
|
||||
let _e27: vec4<f32> = model_matrix_3_1;
|
||||
model_matrix = mat4x4<f32>(vec4<f32>(_e24.x, _e24.y, _e24.z, _e24.w), vec4<f32>(_e25.x, _e25.y, _e25.z, _e25.w), vec4<f32>(_e26.x, _e26.y, _e26.z, _e26.w), vec4<f32>(_e27.x, _e27.y, _e27.z, _e27.w));
|
||||
let _e50: vec2<f32> = a_tex_coords1;
|
||||
v_tex_coords = _e50;
|
||||
let _e51: vec3<f32> = normal_matrix_0_1;
|
||||
let _e52: vec3<f32> = normal_matrix_1_1;
|
||||
let _e53: vec3<f32> = normal_matrix_2_1;
|
||||
normal_matrix = mat3x3<f32>(vec3<f32>(_e51.x, _e51.y, _e51.z), vec3<f32>(_e52.x, _e52.y, _e52.z), vec3<f32>(_e53.x, _e53.y, _e53.z));
|
||||
let _e68: mat3x3<f32> = normal_matrix;
|
||||
let _e69: vec3<f32> = a_normal1;
|
||||
let _e71: mat3x3<f32> = normal_matrix;
|
||||
let _e72: vec3<f32> = a_normal1;
|
||||
normal = normalize((_e71 * _e72));
|
||||
let _e76: mat3x3<f32> = normal_matrix;
|
||||
let _e77: vec3<f32> = a_tangent1;
|
||||
let _e79: mat3x3<f32> = normal_matrix;
|
||||
let _e80: vec3<f32> = a_tangent1;
|
||||
tangent = normalize((_e79 * _e80));
|
||||
let _e84: mat3x3<f32> = normal_matrix;
|
||||
let _e85: vec3<f32> = a_bitangent1;
|
||||
let _e87: mat3x3<f32> = normal_matrix;
|
||||
let _e88: vec3<f32> = a_bitangent1;
|
||||
bitangent = normalize((_e87 * _e88));
|
||||
let _e92: vec3<f32> = tangent;
|
||||
let _e93: vec3<f32> = bitangent;
|
||||
let _e94: vec3<f32> = normal;
|
||||
let _e108: vec3<f32> = tangent;
|
||||
let _e109: vec3<f32> = bitangent;
|
||||
let _e110: vec3<f32> = normal;
|
||||
tangent_matrix = transpose(mat3x3<f32>(vec3<f32>(_e108.x, _e108.y, _e108.z), vec3<f32>(_e109.x, _e109.y, _e109.z), vec3<f32>(_e110.x, _e110.y, _e110.z)));
|
||||
let _e126: mat4x4<f32> = model_matrix;
|
||||
let _e127: vec3<f32> = a_position1;
|
||||
model_space = (_e126 * vec4<f32>(_e127, 1.0));
|
||||
let _e132: mat3x3<f32> = tangent_matrix;
|
||||
let _e133: vec4<f32> = model_space;
|
||||
v_position = (_e132 * _e133.xyz);
|
||||
let _e136: mat3x3<f32> = tangent_matrix;
|
||||
let _e137: vec3<f32> = global1.light_position;
|
||||
v_light_position = (_e136 * _e137);
|
||||
let _e139: mat3x3<f32> = tangent_matrix;
|
||||
let _e140: vec3<f32> = global.u_view_position;
|
||||
v_view_position = (_e139 * _e140);
|
||||
let _e143: mat4x4<f32> = global.u_view_proj;
|
||||
let _e144: vec4<f32> = model_space;
|
||||
gl_Position = (_e143 * _e144);
|
||||
return;
|
||||
}
|
||||
|
||||
[[stage(vertex)]]
|
||||
fn main([[location(0)]] a_position: vec3<f32>, [[location(1)]] a_tex_coords: vec2<f32>, [[location(2)]] a_normal: vec3<f32>, [[location(3)]] a_tangent: vec3<f32>, [[location(4)]] a_bitangent: vec3<f32>, [[location(5)]] model_matrix_0_: vec4<f32>, [[location(6)]] model_matrix_1_: vec4<f32>, [[location(7)]] model_matrix_2_: vec4<f32>, [[location(8)]] model_matrix_3_: vec4<f32>, [[location(9)]] normal_matrix_0_: vec3<f32>, [[location(10)]] normal_matrix_1_: vec3<f32>, [[location(11)]] normal_matrix_2_: vec3<f32>) -> VertexOutput {
|
||||
a_position1 = a_position;
|
||||
a_tex_coords1 = a_tex_coords;
|
||||
a_normal1 = a_normal;
|
||||
a_tangent1 = a_tangent;
|
||||
a_bitangent1 = a_bitangent;
|
||||
model_matrix_0_1 = model_matrix_0_;
|
||||
model_matrix_1_1 = model_matrix_1_;
|
||||
model_matrix_2_1 = model_matrix_2_;
|
||||
model_matrix_3_1 = model_matrix_3_;
|
||||
normal_matrix_0_1 = normal_matrix_0_;
|
||||
normal_matrix_1_1 = normal_matrix_1_;
|
||||
normal_matrix_2_1 = normal_matrix_2_;
|
||||
main1();
|
||||
let _e65: vec2<f32> = v_tex_coords;
|
||||
let _e67: vec3<f32> = v_position;
|
||||
let _e69: vec3<f32> = v_light_position;
|
||||
let _e71: vec3<f32> = v_view_position;
|
||||
let _e73: vec4<f32> = gl_Position;
|
||||
return VertexOutput(_e65, _e67, _e69, _e71, _e73);
|
||||
}
|
Loading…
Reference in New Issue