Hi,
I have a geometry shader and I want to pass some data from this geoshader to my volume shader.
I thought I would be a good idea to use a user data block, but I have some problems using it. Maybe someone can give me a little hint.
I've tried to attach my user data tag to state->options->userdata with:
miTag NewUserDatatag = mi_api_data_append(udTag, state->options->userdata);
And I tried to access this userData with:
But data is always a nulltag. So something went wrong.Code:miTag data = state->options->userdata; int count = 0; while( data != miNULLTAG ) { miUint label; mi_query( miQ_DATA_LABEL, NULL, data, (void *)&label ); mi_info("ud label %d numud %d", label, count++); if( label == 999 ) { mi_info("Found label 999 in User data"); } if( !mi_query( miQ_DATA_NEXT, NULL, data, (void *)&data ) ) break; }
Then I tried to use my own scope as max suggested some time ago:
But this gives me an unbalanced scope error.Code:char *scope = mi_api_scope_apply(mi_mem_strdup("")); mi_api_scope_end(); mi_api_scope_begin(mi_mem_strdup("foo")); //install custom scope miUserdata *ud = mi_api_data_begin(...); ... mi_api_data_end(); mi_api_scope_end(); mi_api_scope_apply(mi_mem_strdup(scope));
So if anyone has an idea how I can access my user data from my volume shader, it would be great to hear how this can work.
Thanks.


Reply With Quote