B.Walters Posted January 2, 2007 Share Posted January 2, 2007 No matter how extreme I set the values to, my image doesn't seem to blur. Neither am I seemingly able to change the filter method ("box", "point", etc), so I assume something is wrong with my code despite the fact that I don't get any errors and the shader successfully renders with a texture map: Cf= texture(texmap, uv.x, uv.y, "filter", filter, "width", width); Another related question: if I only wanted a specific channel (say the alpha channel), how would I access that? Quote Link to comment Share on other sites More sharing options...
stevenong Posted January 2, 2007 Share Posted January 2, 2007 Hi, You have to convert your image to .rat format for filtering to work. I don't know the exact answer to your second question off the top of my head but you want to use a vector4 to represent RGBA then convert it to a vector3 (RGB) and a float(A). Hope the above helps! Cheers! steven Quote Link to comment Share on other sites More sharing options...
B.Walters Posted January 2, 2007 Author Share Posted January 2, 2007 Absolutely, thanks steven! And if anybody knows of a more efficient way to get a specific channel from an image, please let me know as I'm still looking. Quote Link to comment Share on other sites More sharing options...
Mario Marengo Posted January 3, 2007 Share Posted January 3, 2007 And if anybody knows of a more efficient way to get a specific channel from an image, please let me know as I'm still looking. I don't know about more efficient, but, AFAIK, in VEX (and in H8), you can access the individual members of a compound type (like vector and vector4) with the "dot" operator. The predefined names for the four members of a vector4 type are {x,y,z,w} or {r,g,b,a}, so something like this should be possible: // fetch the RGBA texture color vector4 tx = texture(...); // or with an explicit cast, though it shouldn't be necessary // in a simple assignment: // vector4 tx = vector4(texture(...)); // then do stuff with the elements vector RGB = set(tx.r,tx.g,tx.b); float R = tx.r; float G = tx.g; float B = tx.b; float A = tx.a; (untested...) Quote Link to comment Share on other sites More sharing options...
stevenong Posted January 3, 2007 Share Posted January 3, 2007 Please use Mario's suggestion as he knows what he's talking about. Cheers! steven Quote Link to comment Share on other sites More sharing options...
Mario Marengo Posted January 3, 2007 Share Posted January 3, 2007 Please use Mario's suggestion as he knows what he's talking about. Thanks, but so do you! ...however, in all cases, I recommend we all give the last word to crunch's "little bird"... Quote Link to comment Share on other sites More sharing options...
stu Posted January 3, 2007 Share Posted January 3, 2007 ...however, in all cases, I recommend we all give the last word to crunch's "little bird"... Too easy. 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.