ben.toogood Posted March 3, 2003 Share Posted March 3, 2003 evening all, is it true to say that any point attribute (say "life", "numhit", "id") can be passed into a vex shader? I have manged to pass floats and vectors (having found that once they are named as parameters in the parameter list they are in) but seem to be struggling with other attributes. In the attribute spread sheet things like "numhit" and "id" look like ints and ive declared them as int parameters, but they dont seem to be bound and i dont seem to get values from them. should they be passing? or are some attributes nonpassable????? thanks for any help, much appriciated (one week to my deadline and all, ha) ben Quote Link to comment Share on other sites More sharing options...
crunch Posted March 4, 2003 Share Posted March 4, 2003 is it true to say that any point attribute (say "life", "numhit", "id") can be passed into a vex shader? There's a global variable "id" already, so you shouldn't have to pass it in as a parameter. I'm pretty sure "nhit" is an integer attribute (at least if you look at the .geo file, it appears that way). This means that you have to declare the id parameter as an integer. pop testnhit(int nhit=0) { if (nhit > 0) Cd = {1,0,0}; else Cd = {1,1,1}; } Life appears to be 2 floats, so here doesn't seem to be a way to pass in the direct values. However, again, there's a global variable called "life". Quote Link to comment Share on other sites More sharing options...
ben.toogood Posted March 5, 2003 Author Share Posted March 5, 2003 cheers crunchy, what you suggested worked, and worked well. what i would really like though would be for my vex shop shaders to be able to take these attributes, to control allsorts of things. my point attributes pass into the sops level fine, but dont seem to want to be passed into parameters of shaders? i am confused. hope u or some one else knows something. the best i have come up with so far has been to use the attributes in pops to set point color Cd, and then use this in my surface shader.... thaks again ben Quote Link to comment Share on other sites More sharing options...
cs00bren Posted March 10, 2003 Share Posted March 10, 2003 what is it your trying yo do. therre could be another way around the problem. bren Quote Link to comment Share on other sites More sharing options...
ben.toogood Posted March 12, 2003 Author Share Posted March 12, 2003 im trying to utilise collision generated particle point attributes to switch between image sequences used on sprites. I also wish to find the time since the collison so that when a sprite collides, it will play a 'hit' animation and then revert to the usual base image sequence when after the duration of the 'hit' animation. ben Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.