# konstantin magnus

Members

850

70

## Everything posted by konstantin magnus

2. Here is a procedurally animated creature using some of the all new rigging tools. Had to brush up my russian skills1 to get this working ; ) 1 H18.5 Rigging Tutorial: https://www.youtube.com/watch?v=-AFJ5j47pwE spider.hipnc
• 4
• • 3. ## Extruding front and back distance based on curve

Sure, probably like this: vector bbox = relbbox(0, v@P); float mask_side = vector(colormap(image_side, bbox.z, bbox.y)).x; float mask_top = vector(colormap(image_top, bbox.x, bbox.z)).x; f@density = min(mask_side, mask_top);
4. ## Extruding front and back distance based on curve

It's called space carving:
5. ## How handle this mushroom shape procedurally ?

Just gave the gills a little update.
6. Here is the VEX version of the streaking texture procedure. It's pretty flexible now: Starting curves from uncovered areas to any angle, jumping over gaps, gradually changing target direction, measuring curve length for any point and of course texture mapping. Model taken from threedscans.com streaks_VEX_2.hipnc
• 8 replies
• 3
• 7. Currently working on a from-scratch texturing procedure that simulates water running down surfaces. Models shamelessly taken from @animatrix course files. Starting with projected points, the curves run along a volume until they drop onto the next underlying surfaces using nested while loops. The watery effect is achieved in COPs where the texture is drawn based on measuring distance from texture positions to these curves. Alright, enough art, here comes the proof of dripping :
• 8 replies
• 6
• • 8. I aligned vector directions towards some curves (ie. outer edges). How would I orient a stretched noise pattern accordingly? oriented_noise.hiplc
9. ## How I Can Construct a Circle from 3 Points?

I don't think Mohamed is looking for a procedural solution. He may want to do three clicks in the viewport to draw a circle like in a CAD software.
10. Using VEX in a primitive attribute wrangle: setprimintrinsic(0, 'closed', i@primnum, 1, 'set');
• 4 replies
• 1
• 11. ## How handle this mushroom shape procedurally ?

Here's another plant generator this time growing from crevices / occluded areas. It's essentially blending the volume gradient with some curl noise based on distance. mushroom_grow_out.hipnc
12. ## Circle from edges -> Rounded Corner Circle from edges

Hey Nelson, here is the thread on making circles in VEX:
13. ## Change radius of sphere primitive in vex

Hi Ian, set and scale a transform matrix: float scale = chf('scale'); vector pos = chv('position'); int pt = addpoint(0, pos); matrix3 xform = ident(); xform *= scale; int prim = addprim(0, 'sphere', pt); setprimintrinsic(0, 'transform', prim, xform);
14. ## Texture Bombing Tutorial

Thank you @velk. If texture bombing doesn't exist in Redshift, you could bake a texture before rendering. I have posted a file about creating textures from SOPs recently:
• 2 replies
• 8
• • 16. ## How handle this mushroom shape procedurally ?

Hello @kiryha, first of all the torus is a NURBS surface, meaning it's treated as one single primitive which is also already unwrapped in UV space. This makes it an easy target for the primuv-function that is returning the position (or any other attribute) on a primitive at an primitive's intrinsic UV location. Here is what primuv() does to a grid based on a mesh (left) as opposed to a NURBS surface (right): Now when you want to apply a geometry (mesh, points, curves) onto a primitive, it needs to have UV coordinates first. In this case the UVs are based on the grid points positions in relation to the bounding box: v@uvw = relbbox(0, v@P); Because the grid lay on the XZ plane (for no reason in this case) I had to exchange the Z with Y coordinate: @uvw.y = fit01(@uvw.z, 0.2, 0.5); The Z coordinate should then be set to 0 for correctness: @uvw.z = 0.0; So in other words: if the grid was set to the XY plane right away, it's sufficient to transfer the position attribute from the NURBS torus like this: vector UV_grid = relbbox(0, v@P); v@P = primuv(1, 'P', 0, UV_grid); primuv_example.hipnc
17. ## How handle this mushroom shape procedurally ?

Here is my take on the schizophyllum commune: Project a distorted grid on a displaced torus. Iterate over remeshing and relaxing the grid. Scatter random points along the outer edges. Find their shortest paths across the mesh. Convert the curves into a signed distance field. Offset the SDF contour based on curve orientation. The gills can be flipped by negating the orientation along the path curves. mushroom.hipnc
18. ## Randomly scale down particles with a linear field

Hi Karsten, here is a remotely similar example. It's scaling a point grid by proximity to several planes (represented by the large points and their normals). int pt_near = nearpoint(1, v@P); vector clr_near = point(1, 'Cd', pt_near); vector pos_plane = point(1, 'P', pt_near); vector nml_plane = normalize(pos_plane); float dist = planepointdistance(pos_plane, nml_plane, v@P, set(0)); scale_by_plane_dist.hipnc
19. Point cloud based / smoothed occlusion texture going the 2D voxel field / SOP import route. This time featuring a butter squab ; ) texture_occlusion_VOL.hipnc
• 8 replies
• 4
• • 20. I think @acey195 had a solution for this:
21. ## How can I transfer texture color from one geometry to another?

Hi Bill, you can blend colors from surrounding objects into texture maps by filtering point clouds. tex_sample_surface_colors.hipnc
• 1
• 22. A basic proof of concept for texture bombing on 3D surfaces. texture_bombing.hipnc
23. ## Denoting an attribute as "Tex"

Hi P Sis, there is a way to apply metadata to attributes (ie. "texturecoord") with the VEX function setattribtypeinfo(). https://www.sidefx.com/docs/houdini/vex/attribtypeinfo_suite
24. A texture generator for image based direct lighting. This example is just using a tonemapped JPG. Though by appending ToneMap Ql the same procedure works with HDRIs, too. // INPUT vector pos_tex = set(X, Y, 0.0); vector pos_mesh = uvsample(geo_mesh, 'P', 'uv', pos_tex); vector nml_mesh = uvsample(geo_mesh, 'N', 'uv', pos_tex); float a = radians(angle); // IMAGE BASED DIRECT LIGHTING vector clr_sum = 0.0; for(int i = 0; i < samples; i++){ vector2 u = rand(pos_tex * i); vector dir = sample_direction_cone(nml_mesh, a, u); vector pos_ray = pos_mesh + nml_mesh * 1e-3; vector dir_ray = dir * range; vector pos_hit; vector uvw_hit; int prim_hit = intersect(geo_sky, pos_ray, dir_ray, pos_hit, uvw_hit); vector clr_hit = primuv(geo_sky, 'Cd', prim_hit, uvw_hit); clr_sum += clr_hit; } vector clr = clr_sum / float(samples); // OUTPUT vector color = vector(clr); assign(R, G, B, color); texture_hdri.hipnc
• 8 replies
• 1
• 25. A minimalist generator for creating occlusion textures right in COPs. // INPUT vector pos_tex = set(X, Y, 0.0); vector pos_mesh = uvsample(geo_mesh, 'P', 'uv', pos_tex); vector nml_mesh = uvsample(geo_mesh, 'N', 'uv', pos_tex); float a = radians(angle); // OCCLUSION float occ_sum = 0.0; for(int i = 0; i < samples; i++){ vector2 u = rand(pos_tex * i); vector dir = sample_direction_cone(nml_mesh, a, u); vector pos_ray = pos_mesh + nml_mesh * 1e-3; vector dir_ray = dir * range; vector pos_hit; vector uvw_hit; int prim_hit = intersect(geo_mesh, pos_ray, dir_ray, pos_hit, uvw_hit); occ_sum += prim_hit == -1; } float occ = occ_sum / float(samples); // OUTPUT vector color = vector(occ); assign(R, G, B, color); texture_occlusion.hipnc
• 8 replies
• 3
• • ×
• Donations