frading Posted July 16, 2003 Share Posted July 16, 2003 Hi guys, I am trying to generate a 2d image from a shader with 3d patterns applied to color, so that I can then apply this texture on the uvs of my geometry, and have the same results than those with the pattern, but quicker. This should be fairly easy to do, but I cannot find how. Does anyone have a clue? Quote Link to comment Share on other sites More sharing options...
Jason Posted July 18, 2003 Share Posted July 18, 2003 heya frading, there are several methods available to you: first) make sure your object has vertex UV's and then render with "mantra -u myobject" and it'll bake the shader into UV space for you to re-map back on. second) take the texture-generation section out of your shader and write it into a quick COP (should be very easy) and then execute that COP, saving out the texture to apply to your new object make sense? good luck, jason Quote Link to comment Share on other sites More sharing options...
frading Posted July 18, 2003 Author Share Posted July 18, 2003 ok, the first solution you proposed finally works ( at least with a simple sphere ). But I have been warned on another post that this is still in beta and may not always work. But about your second solution, this is not really clear. As I am not yet used to directly write my shaders from nothing, I use VOPs. the simple shader I build is like that: global variable P> space change> splatter > float to vect > Cf nothing more. And I tried to create a VEX compositing generator, and copy/paste the above operators into it. But of course, things are differents in a vex surface shader than in a COP, so global variable aren't the same, and I cannot get the point position of my geometry...So I do not understand how using a COP will help me here. But maybe by writing it directly I will be able to have access to my point position? Quote Link to comment Share on other sites More sharing options...
Jason Posted July 18, 2003 Share Posted July 18, 2003 The basic idea is to use X and Y position in the COPs context as the UV position. This really only holds true if you're generating texture in 2 dimensional space (using uv's, for instance). You're using 3 dimensional texture - P - and so this means you can't effectivly use the COPs method easily to do what you want to do, so this method is probably not really effective for what you want. In VOP terms, you'd usually use a Shader Layer VOP to access your uv's - and in the COPs context you'd substitute this with a Global Parms VOP and use X and Y. Does this make sense? Cheers, Jason Quote Link to comment Share on other sites More sharing options...
frading Posted July 18, 2003 Author Share Posted July 18, 2003 yes, now this makes complete sense. But as I am creating my textures with 3 dimensionnal patterns, this will not be useful to me right now. But I will remember the COP technique for 2d patterns, I like it 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.