Popular Post konstantin magnus Posted November 10, 2019 Popular Post Share Posted November 10, 2019 I wrote a custom render engine in COPs today. While 'engine' is probably a bit far fetched, it's a little ray tracer experimentally supporting: Meshes with UV coordinates Shading on diffuse textures Multiple point lights (including color, intensity, size) Area shadows and light attenuation Ambient occlusion Specular highlights Reflections with varying roughness The snippet basically transforms the pixel canvas to the camera position and shoots rays around using VEX functions like intersect() and primuv(). The rendering process only takes a few seconds. I still have to figure the licensing fees, though COP_render.hipnc 21 Quote Link to comment Share on other sites More sharing options...
Librarian Posted November 10, 2019 Share Posted November 10, 2019 thanx fully functional on 16.5 Quote Link to comment Share on other sites More sharing options...
konstantin magnus Posted November 11, 2019 Author Share Posted November 11, 2019 Here are the single passes for now: 5 1 Quote Link to comment Share on other sites More sharing options...
mestela Posted February 8, 2021 Share Posted February 8, 2021 Funny to stumble across this thread a year later, after I'd been struggling to implement it all day. Worse, to realise I had given it a heart already back when it was first posted, so I'd seen it and forgotten about it! Quote Link to comment Share on other sites More sharing options...
konstantin magnus Posted February 10, 2021 Author Share Posted February 10, 2021 Hi Matt, I can relate to that. The only way to even top this, might be finding your own postings really interesting and new after a few years ; ) 4 Quote Link to comment Share on other sites More sharing options...
konstantin magnus Posted August 28, 2021 Author Share Posted August 28, 2021 A quick example for raytracing through several layers of texture opacity: string image_path = chs('image_path'); vector uv = relbbox(0, v@P); vector4 clr = colormap(image_path, uv); v@Cd = vector(clr); f@Alpha = clr[3]; vector pos[]; int prim[]; vector uvw[]; intersect_all(1, v@P, v@N * 1e3, pos, prim, uvw); vector color_sum = 0.0; float alpha_sum = 0.0; foreach(int i; int pr; prim){ vector color = primuv(1, 'Cd', pr, uvw[i]); float alpha = primuv(1, 'Alpha', pr, uvw[i]); float mask = alpha * (1.0 - alpha_sum); color_sum += color * mask; alpha_sum += mask; if(alpha_sum >= 1.0) break; } v@Cd = color_sum; f@Alpha = alpha_sum; raytrace_alphas.hiplc 1 Quote Link to comment Share on other sites More sharing options...
vinyvince Posted August 30, 2021 Share Posted August 30, 2021 Sexy fish @konstantin magnus Something i have been thinking, is to be able to sample in 3d space all decals or texture bombing stuff so the mesh will inherit the normal from then, and dynamically update build its normal map or eight color from that.. Do you see what i mean @konstantin magnus? I know i could sample the color and so in point space, but obviously everyone will prefer not to have a very high density mesh to get correct sampling result, so i picture this more on the shader based context... Am i right ? ________________________________________________________________ Vincent Thomas (VFX and Art since 1998) Senior Env and Lighting artist & Houdini generalist & Creative Concepts http://fr.linkedin.com/in/vincentthomas Quote Link to comment Share on other sites More sharing options...
konstantin magnus Posted June 12, 2022 Author Share Posted June 12, 2022 I wrote an article explaining the code for the COPs raytracer a little: https://procegen.konstantinmagnus.de/custom-raytracer 5 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.