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.
231 stars 33 forks source link

ISF dimensions #21

Closed pixlwave closed 8 years ago

pixlwave commented 8 years ago

Hi

I think I'm probably going to have to create an example to show this, but I'm using multiple shaders to create multiple textures of varying sizes each time the display refreshes. The VVBuffer objects that are created are always the correct size, however sometimes the shader is drawing into this buffer with the dimensions of a different texture. It's as though the shader is receiving the dimensions previously sent to a different shader. So for example I end up with a mini version of what I would like, and the rest is transparent.

Is there anything obvious that I could be doing to cause this? I'm calling housekeeping() after I've run the various shaders that make up each texture.

If this doesn't make sense, let me know and I'll try isolate the problematic code :)

mrRay commented 8 years ago

"It's as though the shader is receiving the dimensions previously sent to a different shader"

without a concrete example there isn't a good way for me to determine if this is a bug or not- it's definitely possible to tell a scene to render at one size while it renders into a larger texture, so depending on the context the behavior you're describing could be either a bug or a feature.

pixlwave commented 8 years ago

I'm working on distilling my project down into a simple example. Any chance I could e-mail it over to you when I'm done? I'm calling allocAndRenderToBufferSized(size) on each scene so as to reuse them for the different dimension textures that I'm creating.

mrRay commented 8 years ago

sure- ray [at] vidvox [dot] net. please include any ISF files you're using!

pixlwave commented 8 years ago

In case anyone ever has a similar issue, the problem in this instance was initialising the ISFGLScene objects with a shared context as the actual context. This was fixed by simply changing myScene = ISFGLScene(context: sharedContext) to myScene = ISFGLScene(sharedContext: sharedContext)

Thanks Ray!