Jump to content

OskarSwierad

Members
  • Content count

    29
  • Donations

    0.00 CAD 
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by OskarSwierad

  1. Hable and ACES tonemapping

    Hi, I ported Hable's tonemapping algorithm, which is popular in video games now (Uncharted, Unity engine), as a VEX COP node It has only one setting - exposure. It's extremely simple to use, yet preserves saturation nicely and leaves non-burnt-out places untouched. The result is... safe. If I needed more dynamic image, I'd correct it later with other nodes. To use it, create a VOP COP2 Filter node in the img (compositing) context. Then open it and pass R,G,B input through the Hable Tonemapping node: EDIT: Added an additional tonemapping algorithm, ACES - used in Unreal Engine 4.8 onwards. ACES gives more pronounced dark tones (even compared to the original photo!) and less desaturated colors than Hable. On the pictures, Hable, original HDR photo and ACES are compared. Both are equally simple to use. Oskar hable_tonemap.hda aces_tonemap.hda
  2. Hi, Maybe you stumbled upon my video on facebook Houdini Artists. Still, I cross-post because I'd like to get your critique - which is something hard to get on facebook! I'm working on a snow-covered terrain shading and rendering in Mantra. The geometry was sculpted by another artist but I added some details with displacements. I want to achieve a look of smooth, almost untouched snow covering rocky highlands (not Arctic glaciers). What can I improve? ~20 min per frame at 720p on Intel i7-3770 Still frame: For comparison, original terrain model (plain diffuse material):
  3. Hi, Is it possible to use Dirt Mask or Occlusion nodes in SHOP to control displacement strength? (the attached image shows the effect of Dirt Mask) When I try to use any of them to reduce displacement strength on object's edges, Mantra calculates displaced geometry forever. Rendering never starts. Maybe an infinite loop is created that way? Or, ray-sampling-based nodes can't be used for displacement because it's done before the actual rendering? Oskar displacement_dirtmask_problem.hip
  4. Hable and ACES tonemapping

    Hi! I prefer ACES for personal projects or early (concept) renders - and Hable or S-Log for previewing work that will be sent further to compositing. I'd like to build some custom tonemappers at some point. Like in "Advanced Techniques and Optimization of HDR Color Pipelines" by Timothy Lottes: http://developer.amd.com/resources/conference-presentations/ I generate LUTs for Houdini with a standalone Python script: # User options: RANGE_MIN = 0.001 # Minimum input pixel brightness () RANGE_MAX = 10.0 # Max input pixel brightness value LENGTH = 1024 # Number of LUT entries (precision) EXPOSURE = 1.0 # Multiplier. Useful range is 0.125 - 8.0. Default is 1.0 OUTPUT_IN_SRGB = False # False means linear TONEMAPPING = 'SLog' # 'ACES', 'Hable' or 'SLog' import math def saturate(value): return max(0.0, min(value, 1.0)) pass def s_log_tonemap(x): # Adapted from "S-Log: A new LUT for digital # production mastering and interchange applications" # https://pro.sony.com/bbsccms/assets/files/mkt/cinema/solutions/slog_manual.pdf result = ((0.432699 * math.log10(x + 0.037584) + 0.616596) + 0.03) return saturate(result) def hable_tonemap_core(x): # Hable (Uncharted 2) Tonemapping # Adapted from code by John Hable # http://filmicgames.com/archives/75 hA = 0.15 hB = 0.50 hC = 0.10 hD = 0.20 hE = 0.02 hF = 0.30 return ((x*(hA*x+hC*hB)+hD*hE) / (x*(hA*x+hB)+hD*hF)) - hE/hF def hable_tonemap(x): tonemapped = hable_tonemap_core(x) hW = 11.2 whiteScale = 1.0 / hable_tonemap_core(hW) return saturate(tonemapped * whiteScale) def aces_tonemap(x): # ACES Filmic Tone Mapping Curve # Adapted from code by Krzysztof Narkowicz # https://knarkowicz.wordpress.com/2016/01/06/ # aces-filmic-tone-mapping-curve/ tA = 2.51 tB = 0.03 tC = 2.43 tD = 0.59 tE = 0.14 result = (x * (tA*x + tB)) / (x * (tC*x + tD) + tE) return saturate(result) def linear_to_gamma_space(x): return pow(x, 1/2.2) pass def gamma_to_linear_space(x): return pow(x, 2.2) pass def encode_linear_to_log(idx): # From Houdini HDK docs, "The Houdini LUT Format": # p = e^(idx * (ln(in_end) - ln(in_start)) / (length-1) + log(in_start)) return pow(math.e, ( idx*( math.log(RANGE_MAX) - math.log(RANGE_MIN) ) / (LENGTH-1) + math.log(RANGE_MIN) )) def calculate_values(): values = [] for idx in range(0, LENGTH): exposureCorrected = EXPOSURE * encode_linear_to_log(idx) result = 0.0 if TONEMAPPING == 'ACES': result = aces_tonemap(exposureCorrected) if OUTPUT_IN_SRGB: result = linear_to_gamma_space(result) elif TONEMAPPING == 'Hable': result = hable_tonemap(exposureCorrected) if OUTPUT_IN_SRGB: result = linear_to_gamma_space(result) elif TONEMAPPING == 'SLog': result = s_log_tonemap(exposureCorrected) if not OUTPUT_IN_SRGB: result = gamma_to_linear_space(result) values.append(result) return values def generate_text(values = []): txt = [ "Version\t\t3", "Format\t\tany", "Type\t\tC", "From\t\t" + str(RANGE_MIN) + " " + str(RANGE_MAX), "To\t\t\t0 1", "Black\t\t0", "White\t\t1", "Length\t\t" + str(LENGTH), "Sampling\tLog", "LUT:", "RGB {" ] for val in values: txt.append("\t" + str(val)) txt[-1] += " }\n" return ("\n").join(txt)
  5. Advanced Math for Houdini

    I haven't read it yet, but it was recommended on http://realtimerendering.com book list and it's got good reviews on Amazon. 3D Math Primer for Graphics and Game Development, 2nd Edition by Fletcher Dunn et al. As for calculus, there is an old book Calculus Made Easy by Silvanus P. Thompson. Free to download at Project Gutenberg. If you find KhanAcademy's math lessons too long or just want text instead, check out amazing Paul's Notes. This is by a professor, started intially for his students. More cool resources: CodingMath on Youtube. Tightly edited. To the point. 3Blue1Brown on Youtube. More general math. Probably what Igor meant in the original post. Nature of Code. A book about programming behaviors and forces. Could be an easy first step to understanding how solvers work.
  6. @Atom: I encountered that problem too I don't know what could I improve in the shader at the moment. Limit volume bounces, though. Nine is way, way too much. You'll get similar effects with 4, even with 3. GI seems to be of help, but only slightly. What's needed is 10x improvement in speed, not 50%. I'm almost sure that the cause of noise is this: hundreds of samples are sent but - for narrow angles, like 0.99-0.995 - only a few of them contribute to the actual light. To fix this, one should discard samples early, right after calculating the dot product( nN, nI ).
  7. @Dennis: a shader could help here (I don't know what's the cause of the sharp falloff in the middle) geometry_spot_light_v002.hip
  8. Houdini 16 Wishlist

    Have developers discussed any plans for specular anti-aliasing in Mantra in the past? Is it planned, not possible or never mentioned? Thin speculars need outrageous amounts of pixel samples to look stable in animation. I was wondering how to deal with the problem. Ray variance seemed to respond well at first but for smaller reflections its blocks are too broad. Detecting high frequency of normals would be nice - including normal maps and shader displacement. Ideally, Mantra should send more rays there. If that's not possible, it could apply more filtering. Currently, I deal with specular aliasing by changing roughness dynamically, according to normals' derivatives First image is constant roughness 0.005, second is varied 0.005 - 0.25. The third are derivatives.
  9. Hi, The Light Bank doesn't show any lights that are inside an imported HDA. Allowing editing contents doesn't help. What I want is to have an .hda with a lighting rig for many scenes. Is there a way to work with digital assets' lights in Light Bank? Oskar edit: OK, nevermind. Now I use Paramter Spreadsheet instead
  10. Hable and ACES tonemapping

    I edited the original post with an interesting ACES tonemapping. The pictures compare both algorithms with the original photo. Here are also 1D LUT files (of 1024 length) that perform ACES curve. So you can use it straight in render view Range is 0.001 - 10.0. Still untested but seems to be working. (If used in a Lookup node, it requires 'Quantize' parameter to be set to 'Quantize at this node'. I don't know why.) ACES_LUTs.zip
  11. Houdini education

    http://www.rohandalvi.net/commercial/- nice introduction to many basic topics http://www.rohandalvi.net/shader/- when you finally want your own shader, for procedural texturing or layer mixing http://www.cgsociety.org/training/course/vex-in-houdini- great one after you know the basic stuff and want to learn proper programming in Houdini https://www.fxphd.com/fxphd/courseDetails.php?idCourse=368- I heard that this exists but don't know anything about the quality
  12. Snow shader - tips on where to start?

    Legomir renderer the snow as a VDB volume, with a modified Billowy Smoke shader from the material pallette: I also seen a test of his where he converted it to polygons, then rendered with a shader similar to mine (what Izat linked). That is, principled shader + raytraced SSS (plugged in as Ce - emission).
  13. Animated Spot starring Mantra

    Amazing shading, lighting... everything Cheerful look without colors being oversaturated - that's cool too.
  14. Snow terrain (mantra shading and render)

    Thank you both. I just watched Outerra's FMX slides on procedural terrain with interesting features - not just generic. Many similar problems which I encountered were approached in clever, simple ways. For example: - they add horizontal displacements after the typical height noise - slope calculations drive many things: random pebbles placement, more or less random disp, ... - mountain peaks are extra-sharpened I recommend reading it if you're interested in the topic - http://forum.outerra.com/FMX/presentation/
  15. Snow terrain (mantra shading and render)

    Thanks. I agree with all of that As for the blue color, you posted a very nice reference. Maybe my sky is too desaturated (though I intentionally wanted to avoid 'polarizing filter' look).
  16. eetu's lab

    Looks really nice to use, especially with this curve. I have a problem, though, running the file on Houdini 15.0.313. Your node returns that error: Non-float value for 'previewScale' Unknown parameter: '2'
  17. Hable and ACES tonemapping

    Whoa, great Somehow I didn't come across your post when I searched for 'houdini tonemapping'. Having found nothing, I decided to write such a node.
  18. Hable and ACES tonemapping

    VEX code: // Hable (Uncharted 2) Tonemapping // // Adapted from code by John Hable // http://filmicgames.com/archives/75 vector hableTonemap(vector x) { float hA = 0.15; float hB = 0.50; float hC = 0.10; float hD = 0.20; float hE = 0.02; float hF = 0.30; return ((x*(hA*x+hC*hB)+hD*hE) / (x*(hA*x+hB)+hD*hF)) - hE/hF; } vector inputColor = set(_R, _G, _; vector tonemapped = hableTonemap(_exposure * inputColor); float hW = 11.2; vector whiteScale = 1.0f / hableTonemap(hW); tonemapped = tonemapped * whiteScale; assign(_R, _G, _B, tonemapped); // ACES Filmic Tone Mapping Curve // // Adapted from code by Krzysztof Narkowicz // https://knarkowicz.wordpress.com/2016/01/06/ // aces-filmic-tone-mapping-curve/ vector ACESFilm( vector x ) { float tA = 2.51f; float tB = 0.03f; float tC = 2.43f; float tD = 0.59f; float tE = 0.14f; return clamp((x*(tA*x+tB))/(x*(tC*x+tD)+tE),0.0,1.0); } vector tonemapped = ACESFilm(set(_R,_G,_ * _exposure); assign(_R, _G, _B, tonemapped);
  19. Hi, Is there a way to tell GI (indirect) light not to waste photons on the entire huge scene? Just focus on the important room? Regards, Oskar
  20. Thanks. That's the solution Much less photons are wasted, if any
  21. Hi, What can cause such blocky screen-aligned artifacts? The scene file: http://oskarswierad.com/public/houdini/HoudiniDispEarth02.hipnc.zip First, I used just a Mantra Surface shader and got these glitches. So then I tried Ocean FX - the issue still remained, though. It happens only with refractions and Physically Based Rendering. Raytrace engine doesn't have this problem. edit: They seem to disappear above a certain environment brightness value?... Oskar
  22. Thanks for your replies. You're both right, it solves the problem. So when the minimum samples amount is too small, it can lead to a completely dark block initially? that's why it discards the block later, not willing to invest any more samples?
  23. glass render

    Could you post the scene file?
  24. Hi, I'm new to Mantra. I've used Blender Cycles, LuxRender and Indigo Renderer before. In order to learn the new engine well (instead of skipping problems), I lit a free scene from 3Drender.com in Cycles and now I'm recreating it in Mantra. So far, I came across two problems I can't easily solve. - There's a lot of noise from mesh lights, while the spot lights start to look good quite early. Is there a way to fight the mesh light noise without increasing overall pixel samples? I thought that Diffuse Quality would help me with that but it doesn't seem to change much. - Glass (mantra surface) seems to treat 1mm thin glass objects like they were solid, not just double-sided shells. What can cause the problem? Maybe normals get inverted automatically? the scene: cycles vs mantra: http://oskarswierad.com/public/3d/LightingChallenges_Science02_VS.jpg 1x1 pixel samples: http://oskarswierad.com/public/3d/LightingChallenges_Science02_1sample2.jpg render settings: http://oskarswierad.com/public/3d/LightingChallenges_Science02_settings.jpg
  25. Increasing samples for mesh lights in PBR?

    Fake glass (opacity falloff, no refraction). 1h 10min rendertime: Refractive glass. 2h 10min rendertime
×