Mesh Bulge

cybero's picture

I've been examining the OpenCL code for the Mesh Bulge filter from template.

if(amount<0) {
         float tt = maxrange;
         maxrange = -minrange;
         minrange = -tt;

as it happens the maxrange = -minrange; provokes an error in the OpenCL editor pane

read-only variable is not assignable. I know what it means but how to rectify is my question.

my quick & dirty workaround is to remove the offending error lines from maxrange = to -tt; and then I get a working variant in 10.6.2, but surely the kernel is actually AOK in theory code wise, so what gives.

seems a bit of a procrustean bed approach though :-)

Are max and min range supposed to be float 4 ?

I swear it's giving me headache, [apart from it's crashing whilst editing the kernel - ouch] it just doesn't seem to make sense at all, which is probably me not seeing the wood for the trees.

See attached the redrafted variant for MeshBulge mb_redraft_01.qtz. Works after a fashion.

I've also attached the item that just blanks out because the OpenCL kernel routine breaks at the read-only error point previously referred to.

Happens, without fail with the four routines employed to create transforms of vertices &/or normals.

At least I've got something that is working after a fashion, but is it "right" ? :-)

Anyhow - apologies if the problem / workaround and continuing compiler related conundrum has, in fact already been addressed.

P.S

Have just found that Mesh Noise also benefits from a similar quick and dirty edit of the OpenCL kernel.

Shall be posting the reworks up later elsewhere - Mesh Noise and Mesh Bulge brought back into something like a working state of play on 10.6.2.

I have ensured that these have not been saved back into any Repository point, I hasten to add.

They are meant to be working proof of their facilitation in 10.6.2 outside of those standard Repositories, from within which standard Repositories, a couple of the base compositions fail to work, as previously noted and complained of elsewhere upon this site.

P.P.S

You Tube Playlist On which playlist you will find, amongst other items, uploads exhibiting the very responsive Wave redraft, the fully automatic Jiggle redraft, the back on 10.6.2 [possibly paraplegic] Bulge & Noise redrafts, the latter two being the items most benefiting from my late night amputation routines - :-) .

PreviewAttachmentSize
mb.qtz.zip7.38 KB
mb_redraft_01.qtz.zip8.66 KB

gtoledo3's picture
Re: Mesh Bulge

Out of curiosity... I get the idea of "redrafting" the ones that are "broken", but what was the focus of changing the ones that work? Just because of the notations in the editor window?

BTW, did you have the actual window pane that you edit in "tear" or glitch on the sides, and did crashing correlate with taking bigger chunks of code and deleting, even with the Viewer off? 32 bit mode? I ask, because these are issues I've encountered.

toneburst's picture
Re: Mesh Bulge

OpenCL is prone to memory-related crashes, because GPU memory isn't protected in the same way as mainboard memory.

max and minrange are probably float4s because they need to hold 3 values, but there's no float3 in OpenCL, so you have to pad it out with another value, and use a float4 instead.

a|x

cybero's picture
Re: Mesh Bulge

Bulge & Noise were both code amputees :-).

Jiggle was an 'automatic' oddity, just ran without provocation and input, whilst Wave was simply very responsive with audio input. Don't quite get what you mean about notations in editor window, GT.

I've not experienced the tearing or glitching of the Editor panel.

I've only experienced a non Viewer OpenCL editor crash in 10.6.0, never after, though knowing the way these things go around, I wouldn't be at all surprised to find that I'll be eating my words again soon •~

Crashing co-related, usually, to live renders whilst editing, although sometimes editing just edits, the Mesh ceases functioning , or sometimes, functions differently.

Can't quite understand why any other crashes happened.

All edited, rendered & occasionally crashed at 64 bit.

Anyhow - they were all a part of my exploring and rejigging the default Mesh Filter templates; I think what's started me on this little detour was the fact that asking for a Mesh Template crashed QC itself, so I just started looking at how I could exploit Meshes as per the template example[s] and subsequently discovered the 10.6.2 editing workarounds on two of the files, the automatic Jiggle and the remarkably responsive Wave.

cybero's picture
Re: Mesh Bulge

Interesting point, might well look into seeing about redrafting the Mesh Bulge & Noise kernels a little more constructively in due course.

toneburst's picture
Re: Mesh Bulge

There's loads more I'd like to know about OpenCL, but there doesn't seem to be much documentation out there about it, and most of what is available focusses on the backend stuff of setting it up from within an application, which isn't really that useful in QC terms, since most of this is opaque from within the application.

I'm starting to think what I need is an 'Idiot's Guide' to OpenCL, but that the reason such a thing doesn't exist, is that, if you're an idiot like me, there's probably no point even attempting it ;)

I do like to poke my fingers into things I don't understand though....

a|x

cybero's picture
Re: Mesh Bulge

I just realised that I'd managed to confuse the filter Bulge with the Bend filter - Bend does break at the min range - max range statement point and Noise also has a similar breakdown. Bulge is actually pretty resilient.

I've attached the two redrafted items, Bend and Noise - a trivial amount of amputation done.

BTW - these are not intended to be Repository items or Virtual Macros, just to allow for the filtering of a presented Mesh - static or dynamic, within 10.6.2, that just didn't work too well in that installation environment with the default versions of those filters.

I would post the Jiggle, but really the crucial [& trivial] thing there is to set the Friction to a minus value and the tension to say 20 and your DAE shall [should] auto jiggle for you too.

PreviewAttachmentSize
RedraftedMeshFilters.zip30.51 KB

gtoledo3's picture
Re: Mesh Bulge

Finally got a chance to try out the suggestion on Mesh Bend... changing the code on that doesn't get it to not error out on my system. So, it still remains broken ;(

(Amazing about that unpublished port on the line patch though...)

cybero's picture
Re: Mesh Bulge [actually Mesh Bend]

Well thanks for giving the suggestion a try, GT.

Why that code amputation should work for Bend on my system and not on yours [& no doubt others] is a real puzzler.

So too is the fact that items that reliably crash on mine do not crash upon the systems of other QC users - see http://kineme.net/forum/Applications/AudioVisualizations/GLTools14crashM... - works for smokris, but not for me.

Swings & Roundabouts, eh?

Whatever, this thread should most definitely have been called Mesh Bend in any case, [my bad :-)].

As for the Mesh Display patch line port being incorrectly left unpublished, isn't that a result of the 'rush & run' of Snow Leopard's release?

& there's more besides ......

For instance, I still have the GF Log telling me that one of the in built patches - Color Cube [pre-mult Alpha RGBA data required] is of an unsupported type.

WARNING> Core Image filter "CIColorCube" input "inputCubeData" is of an unsupported class "NSData"

as per your thread http://kineme.net/Discussion/General/CIColorCube ?