Masoud Posted April 14, 2020 Share Posted April 14, 2020 (edited) Hello; To create a very high-resolution footprint, I would like to transfer the color attribute from one geometry (from a box, or some sliding particles ) to another geometry ( a grid ), based on a UV texture map (UV on second object). This is something like creating a wet-map, and I don't want to scatter points on a surface to ... (I mean that I know that workflow). Actually I want to extract a very high-quality texture as output. Any idea? Thanks for helping. Edited April 14, 2020 by Masoud Quote Link to comment Share on other sites More sharing options...
Pazuzu Posted April 14, 2020 Share Posted April 14, 2020 16 minutes ago, Masoud said: Hello; To create a very high-resolution footprint, I would like to transfer the color attribute from one geometry (from a box, or some sliding particles ) to another geometry ( a grid ), based on a UV texture map (UV on second object). This is something like creating a wet-map, and I don't want to scatter points on a surface to ... (I mean that I know that workflow). Actually I want to extract a very high-quality texture as output. Any idea? Thanks for helping. Here is a good way to deal with that. https://lesterbanks.com/2019/01/create-uv-based-wetmap-houdini/ Quote Link to comment Share on other sites More sharing options...
konstantin magnus Posted April 14, 2020 Share Posted April 14, 2020 Hi Masoud, you can write attributes directly to a 2D volume inside a solver using a volume wrangle: float radius = 0.02; int prim; vector uvw; float dist = xyzdist(1, v@P, prim, uvw); vector clr_sample = 0.0; if(dist < radius){ clr_sample = primuv(1, 'Cd', prim, uvw) * vector(0.2); } v@clr += clr_sample; The example above is using the usual suspects for transferring attributes, xyzdist() and primuv(). Then the SOP import-node imports attribute values to COPs. color_field.hipnc Quote Link to comment Share on other sites More sharing options...
Librarian Posted April 14, 2020 Share Posted April 14, 2020 (edited) You have on Vimeo ..from Asia some Dude posted a huge library of files about everything on that Teman .. I can't find the link sorry. Edited April 14, 2020 by Librarian Quote Link to comment Share on other sites More sharing options...
Librarian Posted April 14, 2020 Share Posted April 14, 2020 I found him here you gonna find Olaaa la nice stuff to investigate and have fun. vimeo.com/zengchen Quote Link to comment Share on other sites More sharing options...
Masoud Posted April 15, 2020 Author Share Posted April 15, 2020 20 hours ago, Pazuzu said: Here is a good way to deal with that. https://lesterbanks.com/2019/01/create-uv-based-wetmap-houdini/ Hi " Alejandro "; Thanks for the reply. I watched that tutorial and It uses points to transfer attributes, so the quality depends on the number of points... Quote Link to comment Share on other sites More sharing options...
Masoud Posted April 15, 2020 Author Share Posted April 15, 2020 17 hours ago, konstantin magnus said: Hi Masoud, you can write attributes directly to a 2D volume inside a solver using a volume wrangle: float radius = 0.02; int prim; vector uvw; float dist = xyzdist(1, v@P, prim, uvw); vector clr_sample = 0.0; if(dist < radius){ clr_sample = primuv(1, 'Cd', prim, uvw) * vector(0.2); } v@clr += clr_sample; The example above is using the usual suspects for transferring attributes, xyzdist() and primuv(). Then the SOP import-node imports attribute values to COPs. color_field.hipnc Hi " Konstantin "; Thanks for the reply. I don't want to use a 2D plane. Actually I need to access a corresponding pixel in a UV texture when a point collides a primitive (surface). Quote Link to comment Share on other sites More sharing options...
Masoud Posted April 15, 2020 Author Share Posted April 15, 2020 16 hours ago, Librarian said: I found him here you gonna find Olaaa la nice stuff to investigate and have fun. vimeo.com/zengchen Hi " Tesan "; Thanks for the reply. I don't want to scatter extra points on a 2D surface, and I need to access a corresponding pixel in a UV texture when a point collides a primitive (surface). Quote Link to comment Share on other sites More sharing options...
Librarian Posted April 15, 2020 Share Posted April 15, 2020 (edited) You constantly on every Post changing(editing) what you actually want ..its OK You must define first on-grid some flow map make attributes also what your box do on-grid. Than learn this .. new asset-SHOP SURFACE. 2 surface that you need somehow-to combine to get that effect I think. //Read data #pragma label mult "Multiplier" #pragma label spread "Overall Spread" #pragma label DATA "Data Points" #pragma label group "Point Group" surface color_transfer ( float mult = 0.5, spread = 1; string DATA = "$HIP/../VEX/Reading-Data-Points/_datapoints.bgeo.sc", group = "group0";) { float d, Np, pFratt; vector _P, pP, pCd, pVratt, outColor; _P = ptransform("space:camera", "space:world", P); outColor = 0; int p[] = expandpointgroup(DATA, group); Np = len(p); for(int i = 0; i < Np; i++){ pP = point(DATA, "P", p[i]); pCd = point(DATA, "Cd", p[i]); pFratt = point(DATA, "fratt", p[i]); d = distance2(pP, _P); d = exp(-d*d/(pFratt*spread)); outColor += pCd*mult*d; } Cf = outColor; } --------------------------- SMUDGE #define PI 3.1415926535897931 #pragma label Theta "Maximum Theta" #pragma label spread "Overall Spread" #pragma label DATA "Data Points" #pragma label kd "Diffuse" #pragma label ks "Specular" #pragma label bump "Bump" surface qrotation_field ( float Theta = 2.0, spread = 3, kd = 1, ks = 0.5, bump = 0.1; string DATA = "$HIP/../VEX/Reading-Data-Points/_datapoints.bgeo.sc") { float d, Np, theta, pFratt, factor, pspread; vector _P, pP, axis, pVratt; vector4 Q; string group; _P = ptransform("space:camera", "space:world", P); theta = snoise(_P + 0.9, 1, 0.75, 1)*4.5; axis = snoise(_P + 0.05, 1, 0.05, 1); Q = quaternion(theta, axis); _P = qrotate(Q, _P); for(int g = 0; g < 2; g++){ group = concat("group", itoa(g)); int p[] = expandpointgroup(DATA, group); Np = len(p); factor = g + 1; for (int i = 0; i < Np; i++){ pP = point(DATA, "P", p[i]); axis = point(DATA, "N", p[i]); pFratt = point(DATA, "fratt", p[i]); pVratt = point(DATA, "vratt", p[i]); pspread = pFratt*spread/factor; d = distance2(pP, _P); d = exp(-d*d/pspread); theta = 2*PI*(pFratt*2 - 1)*d*Theta/factor; Q = quaternion(theta, axis); _P = qrotate(Q, _P - pP) + pP; } } vector outColor = snoise(_P*0.25, 1, 0.25, 1); vector Nn = normalize(computenormal(P + min(outColor)*bump, N, Ng)); vector diff = diffuse(Nn)*outColor*dot(normalize(-I), N); vector spec = specular(Nn, normalize(-I), fit01(min(outColor), 0.5, 0.1))*0.1; spec += specular(N, normalize(-I), 0.05); Cf = diff*kd + spec*ks; } ------------------------------------------------------------------ CONST TEXTURE #pragma label mode "Mode" #pragma choice mode "uv" "UV :: Geometry coordinates" #pragma choice mode "st" "ST :: Primitive coordinates" #pragma label text "Texture map" #pragma hint text image #pragma label mult "Color multiplier" #pragma hint mult color #pragma label opac "Opacity" #pragma hint opac color #pragma label uv "" #pragma hint uv invisible #pragma label repeat "Repeat coordinates" #pragma hint repeat uv #pragma label offset "Offset" #pragma hint offset uv surface constant_texture ( string mode = "uv", text = "Mandril.pic"; vector mult = {1, 1, 1}, opac = {1, 1, 1}, uv = {0, 0, 0}; vector2 repeat = {1, 1}, offset = {0, 0}) { vector _coord2d, _texture, _color, _repeat, _offset; if(mode == "st"){ _coord2d = set(s, t, 0); } else{ _coord2d = uv; } _repeat = repeat; setcomp(_repeat, 1, 2); _offset = offset; setcomp(_offset, 1, 2); _coord2d = _coord2d*_repeat + _offset; _texture = texture(text, _coord2d.x, _coord2d.y); _color = _texture*mult; Cf = _color*opac; Of = opac; } I hope IT Helps .....and maybe someone can clarify Edited April 15, 2020 by Librarian 1 Quote Link to comment Share on other sites More sharing options...
konstantin magnus Posted April 15, 2020 Share Posted April 15, 2020 3 hours ago, Masoud said: I need to access a corresponding pixel in a UV texture when a point collides a primitive I see. I have broken down all kinds of geometry-to-texture transfers here: 2 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.