mrRay / vvopensource

OSC and MIDI frameworks for OS X and iOS, a framework for managing and rendering to GL textures in OS X, and a functional ISF (interactive shader format) implementation for OS X.
230 stars 33 forks source link

WIDTH and HEIGHT are ingored in passes declaration #31

Open ch-nry opened 5 years ago

ch-nry commented 5 years ago

I have noticed a difference between isf file I developed between the online editor from https://www.interactiveshaderformat.com and millumin (www.millumin.com/). The WIDTH and HEIGHT keywork are ignored in the passes definition in millumin, but workd correctly on interactiveshaderformat. Millumin developer think it''s a bug in this framework.

mrRay commented 5 years ago

hi there-

ch-nry commented 5 years ago

thanks for looking at this problem. This the the isf file i'm working on. (sorry, it's not finished, so not very clean) it's a physical model of a 1d membrane used to distord an image. You should move the initialisation to 0, then click bang to get things to move. flaque_07.fs.zip If I remove the WIDTH and HEIGHT key, the shader did not work at all on https://www.interactiveshaderformat.com, so this key are used in some way in millumin, but it look like the physical model texture is not 50x50 as expected. If the line 260/261 are change to this : deforme.x = color2float(IMG_PIXEL(deriveX, coord50./640.)); deforme.y = color2float(IMG_PIXEL(deriveY, coord50./480.)); the shader look almost as expected. (640 and 480 being the image size).

mrRay commented 5 years ago

according to the ISF spec, WIDTH and HEIGHT are expected to be strings, but they're numbers in the file you sent me. wrap them in some quotes to turn them into strings and i think you'll be back on the right track!

mrRay commented 5 years ago

commit 19437f3698c1a30d4466c9fffee59e55d6fde7b8 updates the framework to recognize numbers in addition to strings- you still need to use strings, but if you forget, your ISF will work regardless in hosts that use this framework. (i checked, the more modern c++ framework already did this)

...i should probably make an ISF linter, i bet that would make it easier to head things like this off at the pass

ch-nry commented 5 years ago

Thanks for the clarification. I was mistaken because I did not get any error, and it was working elsewere... Thanks also for the commit, it will prevent other not to do the same mistake.