mic Posted October 2, 2008 Share Posted October 2, 2008 hello! i have written two shaders - displacement and surface. both of them similarly calculates new 's' and 't' coordinates. I think it would be better to calculate uv space only in the displacement shader and then export the values to surface, it would be faster. can i do this? (shaders written in rsl) Quote Link to comment Share on other sites More sharing options...
Mario Marengo Posted October 2, 2008 Share Posted October 2, 2008 hello! i have written two shaders - displacement and surface. both of them similarly calculates new 's' and 't' coordinates. I think it would be better to calculate uv space only in the displacement shader and then export the values to surface, it would be faster. can i do this?(shaders written in rsl) In RSL, you can combine displacement and shading in a single surface shader, so you're not forced to use message passing. You can still choose to write them separately if you wish, of course. In that case, you can import the st's from a displacement shader (which exports them) using the displacement() function. The import functions are (from the help): float atmosphere( string param; {float|point|color|string} var ) float displacement( string param; {float|point|color|string} var ) float lightsource( string param; {float|point|color|string} var ) float surface( string param; {float|point|color|string} var ) And their VEX analogs: int dimport(string name; {int|float|vector|vector4|matrix|matrix3|string} value&) int limport(string name; {int|float|vector|vector4|matrix|matrix3|string} value&) int simport(string name; {int|float|vector|vector4|matrix|matrix3|string} value&) int shimport(string name; {int|float|vector|vector4|matrix|matrix3|string} value&) Cheers. Quote Link to comment Share on other sites More sharing options...
mic Posted October 2, 2008 Author Share Posted October 2, 2008 thanks a lot, i'll try! 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.