Closed ssbucarlos closed 1 year ago
The shader you linked looks like the correct vertex shader. Compute shaders are just used for vertex skinning and a few other specific tasks. Here's the relevant code that's already been analyzed and ported to ssbh_wgpu. The non obvious part is flipping twice for the y coordinate.
vec2 transformUv(vec2 uv, vec4 transform) {
float x = transform.x * (uv.x - transform.z);
float y = 1.0 - transform.y * (1.0 - uv.y - transform.w);
return vec2(x, y);
}
oh i may mave messed up with my RE then lol let me double check
also idk why i said compute shader , edited the comment
These are the blender shader nodes i ended up that seem to reflect the changes when i mess around with the cv31 input values in renderdoc
Can you factor out the scale and move the multiply node after the add? You should be able to do scale * (a+b)
instead of a*scale + b*scale
.
oh wait ur so right i can do that. Im not sure what i did wrong, but i swear that was among the first things i randomly tried and i thought it didnt work and thats why i went to go look at the vertex shader stuff in render doc lol
Ok this is what i got now
Just for future reference, class properties of a custom node don't call the 'update' function when updated by a driver. So while this was how i wanted the interface to look like for simpler code, i will need to make a slightly more complicated internal node/driver setup to use shading node inputs to control the values instead.
Making this to checkout a topic branch. Need to update drivers + the sampler node, i will be using this partially REd vertex shader as reference. But basically the translate component is also affected by the scale component. partial_re_eye_compute_shader.zip