slayerk Posted February 4, 2012 Share Posted February 4, 2012 (edited) Im just end to write main part of my own surface shader. package contains compile.sh - linux bash script for compiling this shader into *.otl-file, source code for this shader and 2 *.otl-files for Houdini 11.1 and Houdini 12.0. compile.sh Need to correct Line: H_INSTALL=~/tools/bin to correct Houdini Install dir (Folder which contains a set of "hfs<VERSION>" folders). also need to correct lines: compile "11.1.118" compile "12.0.526" to compile shader with you installed versions of Houdini. Very Welcome to comments on code and possible mistakes. A test turntable and some of export passes (without any compositing): 1m 10s - 1m 20s per frame on Phenom X6 1100T RAM 8Gb 1333MHz. image res: 1200x804. shader.tar.gz Edited February 5, 2012 by slayerk Quote Link to comment Share on other sites More sharing options...
moondeer Posted February 4, 2012 Share Posted February 4, 2012 how fun is this?! i've been exploring your shader a bit. i really like having an occlusion tab. i've never really seen anything like it. also, on the reflection tab i'm really loving the fresnel fade. another shader control i haven't had much experience with. thanks for the ETA variable as well. this will help to match real world materials. .... now i am going to play a bit more. Quote Link to comment Share on other sites More sharing options...
symek Posted February 5, 2012 Share Posted February 5, 2012 Very nice, thank you! I like controls for optional masking. There is a question about occlusion pass though. You seem to be adding it to Cf, which doesn't always play nicely with rest of material's components. Basically, if an occlusion meant to be environment light, that's fine (though begs for a question why this light obey self occluding, unlike direct component). On the other hand, if an occlusion doesn't have environment map applied, it's more like a map to be used as a modulator for most other components (including reflections with different cone angle for occlusion rays). If you simply add it to Cf, your object gets magically brighter than supposed to be. That's why there is a second occlusion() method, which gives you separated shadowing and bend normals to lookup environment map. This way you can add lighting from the environment, leaving the occlusion float as a multiplier for this and other components. Also, it would be cool to provide your shader as a VOP node. cheers! skk. Quote Link to comment Share on other sites More sharing options...
slayerk Posted February 5, 2012 Author Share Posted February 5, 2012 (edited) Very nice, thank you! I like controls for optional masking. There is a question about occlusion pass though. You seem to be adding it to Cf, which doesn't always play nicely with rest of material's components. Basically, if an occlusion meant to be environment light, that's fine (though begs for a question why this light obey self occluding, unlike direct component). On the other hand, if an occlusion doesn't have environment map applied, it's more like a map to be used as a modulator for most other components (including reflections with different cone angle for occlusion rays). If you simply add it to Cf, your object gets magically brighter than supposed to be. That's why there is a second occlusion() method, which gives you separated shadowing and bend normals to lookup environment map. This way you can add lighting from the environment, leaving the occlusion float as a multiplier for this and other components. Also, it would be cool to provide your shader as a VOP node. cheers! skk. I never use occlusion as multiplyer when i render cg objects. When I insert rendered objects in real shot i render a shadow and occlusion pass for multiplying on real shot image. for example: cg car going on real road. Camera tracking, rough road geometry and environment. cg car cast occlusion and shadows on road. in this case i render occlusion and multiply on shot image to simulate environment shadow from car on the road. cg car rendered with a road (and rough environment if it is) marked as "Phantom Object" for reflections and occlusion. I especially include a source code for you freedom. And tried to make it clear and understandable. If you frequently use occlusion as multiplyer you can make it! I'm planned to add a gather occlusion (now occlusion calculates with occlusion() function) - it gives me not only occlusion but a GI. and also irradiance which calculates with irradiance() function. occlusion() and irradiance() - more specific and narrow function in compare with gather, but he is faster. Also, it would be cool to provide your shader as a VOP node. Good idea like a co-shader! but i represent how much inputs he would be have. a vop node with vertical length -> ∞. also shader have a lot of export variables: export vector exportRawConstant=0; export vector exportConstantIntensity=1; export vector exportConstant=0; export vector exportRawDiffuse=0; export vector exportDiffuseIntensity=1; export vector exportDiffuse=0; export vector exportRawSpec01=0; export vector exportSpec01Intensity=1; export vector exportSpec01=0; export vector exportRawSpec02=0; export vector exportSpec02Intensity=1; export vector exportSpec02=0; export vector exportRawSpec03=0; export vector exportSpec03Intensity=1; export vector exportSpec03=0; export vector exportRawOccl=0; export vector exportOcclIntensity=1; export vector exportOccl=0; export vector exportEnv=0; export vector exportRawReflect=0; export vector exportReflectIntensity=1; export vector exportReflect=0; export vector exportRawRefract=0; export vector exportRefractIntensity=1; export vector exportRefract=0; export vector exportSSS=0; export vector exportMask01=0; export vector exportMask02=0; export vector exportMask03=0; export vector exportMask04=0; export vector exportMask05=0; and each gather loop has his own export variables: export vector export##prefix##GatherReflComp=0; \ \\ - integrate only rays who hit any surface export vector export##prefix##GatherEnvComp=0; \ \\ - integrate only rays who hit environment export float export##prefix##GatherOcclComp=0 \\ - black/white image represents a reflection occlusion for reflect prefix is "reflect" ans names would be: export vector exportreflectGatherReflComp=0; \ export vector exportreflectGatherEnvComp=0; \ export float exportreflectGatherOcclComp=0 analogically for refract. Edited February 5, 2012 by slayerk Quote Link to comment Share on other sites More sharing options...
chumbuk Posted February 7, 2012 Share Posted February 7, 2012 Cool shader! Thanks for sharing! Quote Link to comment Share on other sites More sharing options...
symek Posted February 7, 2012 Share Posted February 7, 2012 I never use occlusion as multiplyer when i render cg objects. This doesn't work with mixed lighting, when you want occlusion effect for self shadowing, but not environmental light, since light comes from different sources. It could be an option in Occlusion Tab (mult or add). Surely people could mess with the code, but seriously anyone who can do it, can do his own shader anyway . Nice renders! cheers, skk. Quote Link to comment Share on other sites More sharing options...
slayerk Posted February 9, 2012 Author Share Posted February 9, 2012 This doesn't work with mixed lighting, when you want occlusion effect for self shadowing, but not environmental light, since light comes from different sources. It could be an option in Occlusion Tab (mult or add). Surely people could mess with the code, but seriously anyone who can do it, can do his own shader anyway . Nice renders! cheers, skk. myltiply by occlusion and fake caustics added. shader.tar.gz Quote Link to comment Share on other sites More sharing options...
papicrunch Posted February 14, 2012 Share Posted February 14, 2012 Hey, Nice shader thank to share it ! have fun, Thomas Quote Link to comment Share on other sites More sharing options...
slayerk Posted June 29, 2012 Author Share Posted June 29, 2012 (edited) 29.06.2012 Version 0.6 Added "Screen Space" in UV Layer Menu to Project Textures On Geometry via Shader Added Texture Filtering Method Menu Choice Edit "Fake Caustics" Shadow Calculation. Now respect refract Refract Intensity and Intensity Map Luminance shader.tar.gz Edited June 29, 2012 by slayerk Quote Link to comment Share on other sites More sharing options...
slayerk Posted August 25, 2012 Author Share Posted August 25, 2012 (edited) Update: // Version 0.61 // Added Possibility to use baked texture to Difuse And Occlusion (Non View Dependent components) // Version 0.62 // Added option to not calculate occlusion if ray level>0. See Occlusion Tab. Usful for Some Situations. // Version 0.63 // Added Color Correction SubTab on reflection Tab. Usful for emitating metal's colored reflections. shader.rar untitled.hip Edited August 25, 2012 by slayerk Quote Link to comment Share on other sites More sharing options...
qbick Posted August 26, 2012 Share Posted August 26, 2012 Update: // Version 0.61 // Added Possibility to use baked texture to Difuse And Occlusion (Non View Dependent components) // Version 0.62 // Added option to not calculate occlusion if ray level>0. See Occlusion Tab. Usful for Some Situations. // Version 0.63 // Added Color Correction SubTab on reflection Tab. Usful for emitating metal's colored reflections. awesome shader! thanks. is it possible to create color-bleeded ambient occlusion like mentalray's architecturial shader? like on the pic http://imagic.ddgenvivo.tv/forums/newsgambocc/poc1a.jpg Quote Link to comment Share on other sites More sharing options...
slayerk Posted August 26, 2012 Author Share Posted August 26, 2012 awesome shader! thanks. is it possible to create color-bleeded ambient occlusion like mentalray's architecturial shader? like on the pic http://imagic.ddgenvivo.tv/forums/newsgambocc/poc1a.jpg I think irradiance() will be great for this effect. will add his soon. Quote Link to comment Share on other sites More sharing options...
kgoossens Posted August 26, 2012 Share Posted August 26, 2012 I think irradiance() will be great for this effect. will add his soon. Upload it on orbolt, makes it easier to install, follow your work etc... Quote Link to comment Share on other sites More sharing options...
slayerk Posted August 27, 2012 Author Share Posted August 27, 2012 Upload it on orbolt, makes it easier to install, follow your work etc... done! http://www.orbolt.com/asset/_slayerk::my_shader_v01 1 Quote Link to comment Share on other sites More sharing options...
Ole Posted August 29, 2012 Share Posted August 29, 2012 Maybe add edge bevels as an option? Quote Link to comment Share on other sites More sharing options...
slayerk Posted September 6, 2012 Author Share Posted September 6, 2012 (edited) // Version 0.64 // Added Irradiance. // Added "Occlusion Tint" Parameter in Occlusion Tab // Added "Options" for controlling Special Parameter "Use Emission". // Emission Used for calculation irradiance. if globalraylevel()>0 and "Use Emission" enabled, then diffuse and occlusion doesn't calculates, // emission color is used instead. It's usful for increase "color bleeding effect". because // real irradiance gives almost invisible result, especially on small number of GI bounces. // Use it with 1 GI bounce for fast fake GI. // Typical behavior is to use the same "Tint Color" for "Diffuse/Diffuse Color", "Occlusion/Occlusion Tint", // "Irradiance/Irradiance Tint" and "Options/Emission Color" theese are all diffuse-based components. // "Use Emission" is a fast way to fake GI and colorize dark areas. "Emission Color" is a measure of "Bleeding Effect". // You also may to calcula real Gi by Disabling "Use Emission". // // Version 0.65 // Added ColorCorrection Parameters to Speculars. Usful for emitating metal's colored speculars with colored Light Emitters. new export variables: vector exportRawIrrad vector exportIrradIntensity vector exportIrrad test_my_shader.hip shader.rar Edited September 6, 2012 by slayerk Quote Link to comment Share on other sites More sharing options...
Netvudu Posted September 6, 2012 Share Posted September 6, 2012 Orbolt asset browser still shows v0.63? Quote Link to comment Share on other sites More sharing options...
jim c Posted October 9, 2012 Share Posted October 9, 2012 I'm trying to experiment with this. I've pulled it down from Orbolt, but when I try and use it I get this error mantra: VEX error: Unable to load opdef:/_slayerk::Shop/my_shader_v01 Path not found This is in Houdini FX 12.1.69 HD Non Commercial, Windows 7 64 bit Quote Link to comment Share on other sites More sharing options...
jim c Posted October 9, 2012 Share Posted October 9, 2012 (edited) OK, I downloaded the latest and got it to work. Looks good so far. However, does it support PBR? WHen I render a simple cube, it just shows black. When I switch back to raytrace or Micropoly then it works. Also, thnkas for posting this! It's got a ton of options I'm very curious to fiddle with. Edited October 9, 2012 by jim c Quote Link to comment Share on other sites More sharing options...
slayerk Posted October 9, 2012 Author Share Posted October 9, 2012 OK, I downloaded the latest and got it to work. Looks good so far. However, does it support PBR? WHen I render a simple cube, it just shows black. When I switch back to raytrace or Micropoly then it works. Also, thnkas for posting this! It's got a ton of options I'm very curious to fiddle with. Not I'm never use PBR because don't like to wait. My typical limit to production frame is 20 min/frame for 2k (this is PRODUCTION limit. when I setting up the scene I, obliviously, want to work more interactively). if rendertime is more than this limit I need to optimize something or make more compositing work. maybe turn off something and etc. This is the reason why i always use micropoly. Only micropoly. I also never using a raytrace engine. this shader is distributed with source code if you have a desire to implement it for PBR - lets go! 1 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.