Macha Posted February 7, 2012 Share Posted February 7, 2012 (edited) I want to set points to a minimum size so that they will never be smaller than a pixel. What is the best way of doing this? I assume I take the distance to the camera-plane (uv texture z) and then find out how big a pixel would be if moved at that distance? Any objections? Better ways? Like this? http://en.wikipedia.org/wiki/Angular_diameter Edited February 7, 2012 by Macha Quote Link to comment Share on other sites More sharing options...
hopbin9 Posted February 7, 2012 Share Posted February 7, 2012 They will always render across the border between neighboring pixels, unless you disable all aliasing. With aliasing it'll be very hard to render as just a single pixel. What effect are you trying to create? Quote Link to comment Share on other sites More sharing options...
Macha Posted February 7, 2012 Author Share Posted February 7, 2012 (edited) Real size doesn't matter so much because I can scale. As long as I have a consistent base-scale relative to pixelsize it's OK. I am trying to avoid rendering artifacts when points get too small. I want them to have a minimum size that relates to the pixelsize. Edited February 7, 2012 by Macha Quote Link to comment Share on other sites More sharing options...
eetu Posted February 7, 2012 Share Posted February 7, 2012 I think a transform to camera space and division by z in a vopsop would suffice. If you want to get fancy, you could try and offset the extra area resulting from the clamping by decreasing alpha accordingly. Quote Link to comment Share on other sites More sharing options...
Macha Posted February 7, 2012 Author Share Posted February 7, 2012 (edited) I believe this works, trying to get the angular size of a pixel (circle enclosing the pixel) and then converting to real size. -UV texture camera. 3rd component is distance to camera plane -pscale = tan(((arctan((aperture*0.5)/focal)*2)/resx)*0.5)*distance*2 At least, when I render it gives a likely result, each sphere retaining a constant size. Edit: Oh, missed that Eetu. I'll have a go and try it. Edited February 7, 2012 by Macha Quote Link to comment Share on other sites More sharing options...
moondeer Posted February 7, 2012 Share Posted February 7, 2012 awesome concept. this would net the best possible render. would you also use this technique to maintain a visual density? for example a cloud of points has a visual density of 50% when rendered at 1000px x 1000px. that same cloud when rendered at 100px x 100px would still try to render all points, but now the cloud is opaque. for a truly procedural approach to maintain the 'feel' of the effect as you render at higher or lower dimensions you would have to ignore some of the points at rendertime. this would also give the advantage to look development at low resolutions. Quote Link to comment Share on other sites More sharing options...
eetu Posted February 7, 2012 Share Posted February 7, 2012 (edited) Ok, now in front of Houdini it wasn't that easy after all, seems like Transform VOP doesn't do pretty much anything in SOPland. If your way works, run with it Edited February 7, 2012 by eetu Quote Link to comment Share on other sites More sharing options...
symek Posted February 7, 2012 Share Posted February 7, 2012 (...)seems like Transform VOP doesn't do pretty much anything in SOPland. http://www.sidefx.com/docs/houdini11.1/vex/functions/toNDC note second signature, it does work in SOPs ps Macha, have you seen beta journal on the very subject? Quote Link to comment Share on other sites More sharing options...
eetu Posted February 7, 2012 Share Posted February 7, 2012 http://www.sidefx.com/docs/houdini11.1/vex/functions/toNDC note second signature, it does work in SOPs Ahh! Good man. const_psize11.hip Quote Link to comment Share on other sites More sharing options...
symek Posted February 7, 2012 Share Posted February 7, 2012 Interesting, at first I've thought I could use Du/v() on toNDC(P), but it seems like derivatives for "render as points" are {0,0,0}, which kind of makes sense, except it's extremely disappointing Quote Link to comment Share on other sites More sharing options...
Macha Posted February 9, 2012 Author Share Posted February 9, 2012 (edited) I'll have a little twist to this: How could we get size of any object in the scene in terms of pixels? Edit: Wait...that should be this then..in inline vex...right, if pscale is the object bounding sphere size? float pixeldiameter, objectdiameter; $pixeldiameter = (2*atan($aperture/(2*$focal)))/$resx; $objectdiameter = 2*asin(0.5*$pscale/$distance); $out = $objectdiameter / $pixeldiameter ; I"m not sure...it doesn't look obviously wrong when I try it. I'm trying to compare the angular size of a pixel with that of the object (bounding sphere). If $out falls below 1 then it's smaller than a pixel. Maybe. and to just get relative pixelsize at distance from camera: float pixeldiameter, pixeldiameterFar; $pixeldiameter = (2*atan($aperture/(2*$focal)))/$resx; $pixeldiameterFar = 2*$distance*sin($pixeldiameter/2); $out = $pixeldiameterFar; Edited February 9, 2012 by Macha 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.