but0n / Ashes

WebGL2.0 3D Engine - Global Illumination - RayTracing
https://codepen.io/but0n/pen/jddYoX
MIT License
328 stars 16 forks source link

Some samples do not work after updating to Ashes 0.1.2 #29

Closed cx20 closed 5 years ago

cx20 commented 5 years ago

I tried to run a simple shader example with Ashes 0.1.2. However, some samples have stopped working. Is it because the usage has changed?

Ashes v0.1.1 + Simple Shader result: OK https://jsfiddle.net/cx20/bw4v7qp6/6/

Ashes v0.1.2 + Simple Shader result: NG https://jsfiddle.net/cx20/bw4v7qp6/7/

but0n commented 5 years ago

Yeah, the view matrix and projection matrix has been abandoned in v0.1.2, considering it’s unnecessary to compute P*V for each vertex.

The VP matrix is available in v0.1.2: https://github.com/but0n/Ashes/commit/8f6ebc76d7e92a5b7dde8ba5e741548fed2c5d71#diff-a2a681c8556077532c32ea2e2ef4fb98L150

gl_Position = VP * M * position;
but0n commented 5 years ago

Thanks for your feedback! I will reopen V and P matrix for backward compatibility in v0.1.3.

cx20 commented 5 years ago

Thank you for telling me about the specification change. I think this project is an early version, so there is no need to worry about backward compatibility. However, if possible, it is nice to see an error message on the console to let you know that a specification change has been made.

but0n commented 5 years ago

I noticed this refactor caused huge influence to those old examples which involve PBR material, so I've added this folder for quick fix: https://github.com/but0n/Ashes/tree/master/res/shader_old

Those old examples would be fixed by simply modify the shader path:

// Material.SHADER_PATH = CDN + Material.SHADER_PATH;
Material.SHADER_PATH = CDN + 'res/shader_old/';

BTW, those shader sources is already be a part of library after v0.1.2 to avoid this problem