Forums > Jitter

Updating shader code

June 3, 2013 | 5:10 am

Anybody has an idea if i can update shader code without saving to file and reloading with or I mean if i’m editing the code as text inside max, then send out that text to the appropriate shader object?

June 4, 2013 | 1:31 am

The best I know is described in the following Jitter example patch -> jitter-examples/render/shaderwriter-example.pat

Not sure if this answers your question though…

June 4, 2013 | 4:04 am

Thanx, it’s a good way of editing shaders, but it still saving the file before reloading… what’s not so bad, just was wondering if i can do without it… maybe there is an external or java class for that…

June 4, 2013 | 5:54 am

I know of no way in Max with the default objects/externals to load a shader program in any way other than from a file system path.

You could use the Max SDK and write your own OpenGL external in C which can do exactly what you want. I’ve written externals using the SDK and I caution you that it is not a trivial task. I don’t recommend you do it for this feature. I doubt the time/effort you would invest will give you any significant advantage over reading in a file.

Instead, I suggest you look into the file i/o features of Max, Javascript, Java, or LUA to generate, save, and then load a shader program file (JXS) into a

June 4, 2013 | 11:15 am

Thanx Dale, yeah for sure i can do it by writing and rereading and not a heavy processing soultion at all, just thought, it’s some kind of resource waste to use the HDD for this :D i dont’ think i’ll try to do my OpenGL external for this… didnt coded openGL in C yet, so would be a too long learning curve i guess…

Viewing 5 posts - 1 through 5 (of 5 total)