Jump to content

konstantin magnus

  • Posts

  • Joined

  • Last visited

  • Days Won


Everything posted by konstantin magnus

  1. To animate the spider web threads, you would pin the end points and set vellum to the constraint type 'string'. For membranes to 'cloth'. spiderweb.hipnc
  2. For static models I mostly just fake gravity based on curve lengths or surface distances: https://procegen.konstantinmagnus.de/spider-web https://procegen.konstantinmagnus.de/minimal-surface-membrane Eg. for resampled curve segments on a spider web, a is the user defined hanging amount, u the relative and r the absolute length. u * (1.0 - u) is a function to make the curves hang in their center. float a = chf('amount'); float u = vertexcurveparam(0, i@vtxnum); float r = primintrinsic(0, 'measuredperimeter', i@primnum); v@P.y -= u * (1.0 - u) * a * r; spiderweb.hipnc
  3. Cool, I've just replaced the iterative approach by a tracer that does practically the same thing. int steps = chi('steps'); float w = chf('width'); float dist = 0.0; if(f@mask < 0.5){ vector pos = v@P; for(int i = 0; i < steps; i++){ vector grad = volumegradient(0, 'height', pos); pos -= normalize(grad) * w; float mask = volumesample(0, 'mask', pos); if(mask > 0.5){ dist = 1.0 - i / (steps - 1.0); break; } } } f@mask = max(f@mask, dist); snow_accum.hipnc
  4. Hi Isaac, in this case couldn't you work with one ray, eg. using the ray SOP with inverted normals? thickness.hipnc
  5. Hi Ploy, you could streak the object mask on towards the gradient. heightfield_snow.hipnc
  6. I think you would still need to correct the point numbers to really make all the tiles match, but yeah, I'm glad it's useful.
  7. Copy the height fields to the points of an octahedron to shape a cube, apply noise there and assign them to a cross. Alternatively try sampling the world position noise from a cube mesh right away: int index[] = array(0,2,1,3,5,4); vector bb = relbbox(0, v@P); vector uvw = set(bb.x, bb.z, 0.0); vector pos = primuv(1, 'P', index[i@primnum], uvw); float height = noise(pos * 50.0) * 200.0; f@density = height; heightfield_cube.hipnc
  8. Hi Natiq, maybe there is a node for this, but you could overlap both height fields and sample them into a new one: float band = chf('band'); float h_0 = volumesample(1, 'height', v@P); float h_1 = volumesample(2, 'height', v@P); float mask = smooth(-band, band, v@P.x); f@height = lerp(h_0, h_1, mask); hf_blend.hip
  9. Hi Ping-Yen, we had this a while back: https://www.sidefx.com/forum/topic/79315/#post-341726
  10. A low-poly helicopter from a sweep and some extrusions. Raycasted to shine on a CRT monitor.. helicopter.hipnc
  11. Thank you Tesan! I've just translated the first example from C to VEX for a volume wrangle. // Use Monte Carlo integration and ray marching // of signed distance field (SDF) to render emissive circles. // Source: https://github.com/miloyip/light2d/blob/master/basic.c int samples = chi('samples'); function float sd_circle(vector2 uv, pos; float radius){ float dist = distance(uv, pos) - radius; return dist; } function float sd_scene(vector2 uv){ float d_0 = sd_circle(uv, {0.3, 0.18}, 0.12); float d_1 = sd_circle(uv, {0.25, 0.18}, 0.12); float d_2 = sd_circle(uv, {-0.3, -0.2}, 0.02); float dist = min( max(d_0, -d_1), d_2); return max(dist); } function float trace(vector2 uv, dist){ float t = 0.0; for(int i = 0; i < 100 && t < 2.0; i++){ float sd = sd_scene(uv + dist * t); if(sd < 1e-5) return 1.5; t += sd; } return 0.0; } function float sample(vector2 uv; int samples){ float sum = 0.0; for(int i = 0; i < samples; i++){ float a = 2.0 * PI * ((rand(uv) + i) / float(samples)); sum += trace(uv, set(cos(a), sin(a))); } return sum / float(samples); } vector2 uv = set(v@P.x, v@P.y); f@d = sample(uv, samples); light_2D.hip
  12. Hi Robert, yes, you can integrate the minimal surface position with the ray node or minpos(). I've added the pig head to the food input to motivate growth there, as well. mycelium_3d.hipnc
  13. Hi @sessionbeer, not quite the same, but this one comes close: https://procegen.konstantinmagnus.de/growing-a-mycelium
  14. Here's a way to draw a 2D SDF-curve. sdf_curve.hipnc
  15. Hi @Krion, the spline()-function can do this: https://www.sidefx.com/docs/houdini/vex/functions/spline.html
  16. Hi Masoud, there are probably some particle operators doing the same thing faster, but you could pull and push a voronoi-network according to the point scales until all spheres are deintersected. deintersect_spheres.hip
  17. Hi @virgile, you could blend positions based on their distance towards the surface: In a point wrangle with first input mesh, second input sphere: float d_min = chf('min_distance'); float d_max = chf('max_distance'); int prim; vector uvw; float d = xyzdist(1, v@P, prim, uvw); vector pos = primuv(1, 'P', prim, uvw); float mask = smooth(d_min, d_max, d); v@P = lerp(pos, v@P, mask); conform_to_surface.hipnc
  18. What would be the current preferred language to script patterns for Renderman inside Solaris? Eg. turning UV coordinates into dots and stripes as color vectors or float masks: vector uv = v@uv; float d = distance( frac(uv*8), {0.5, 0.5, 0.0} ); float c = 1.0 - smooth(0.2, 0.5, d); v@Cd = c;
  19. You would need another vector called "up" that points upwards, eg. v@up = {0,1,0};
  20. Hi Mani, before exporting you can promote primitive attributes to vertex UVs and/or vertex normals and promote them back after importing the OBJ. Wikipedia describes the OBJ-format: The OBJ file format is a simple data-format that represents 3D geometry alone — namely, the position of each vertex, the UV position of each texture coordinate vertex, vertex normals, and the faces that make each polygon defined as a list of vertices, and texture vertices. obj_attrib.hip
  21. Try the circle from edges-node in case the holes are supposed to be circular.
  22. Hi Curt, did you look into the hole SOP?
  23. There is a Kelvin Wakes deformer in SideFX Lab's now: https://www.sidefx.com/docs/houdini/nodes/sop/labs--kelvin_wakes_deformer-1.0.html
  24. How would you blend positions between meshes with different topology and uneven point count? My idea was to use the 'underlying' primitive's intrinsic UV coordinates for matching. But when transfering to world position I run into this typical "fix boundary seams"-issue known from the UV texture-node. blend_pos.hip
  25. Polyextrude does UVs. Just assign UVs on the grid in advance and ignore the viewport issue that comes later. extrude_uv.hip
  • Create New...