actarian / vscode-glsl-canvas

Live WebGL preview of GLSL shaders
MIT License
335 stars 25 forks source link

Docs: example how to load an .obj #50

Closed polyclick closed 3 years ago

polyclick commented 3 years ago

Hi

I can't seem to figure out how to load a custom .obj, can we get an example in the docs or playground on how to do this?

Thanks

actarian commented 3 years ago

Hi @polyclick, here you can find a working example: https://github.com/actarian/glsl-canvas/blob/master/docs/shaders/example-basic.glsl

You should load the obj model by commenting the a_position attribute in the vertex shader.

Es.

if defined(VERTEX)

attribute vec4 a_position; // data/dolphin.obj ...

polyclick commented 3 years ago

Thanks! This works :)