kensonuken Posted December 14, 2008 Share Posted December 14, 2008 I want to make sss into each light pass.. can anybody help me on this... Quote Link to comment Share on other sites More sharing options...
Wolfwood Posted December 14, 2008 Share Posted December 14, 2008 (edited) The easiest approach would be do to multiple render passes. Enable just one light, render, enable a different light, render. Then composite them all back together. It is possible to use Light Exports, so you do just one render and then each light's contribution gets stored in the image as a Deep Raster. However the SSS shader in Houdini currently doesn't support Light Exports. Edited December 14, 2008 by Wolfwood Quote Link to comment Share on other sites More sharing options...
kensonuken Posted December 14, 2008 Author Share Posted December 14, 2008 I was looking for Henrik jensen`s shader? is there any rsl or vex source for that shader.....? Quote Link to comment Share on other sites More sharing options...
Wolfwood Posted December 15, 2008 Share Posted December 15, 2008 I was looking for Henrik jensen`s shader? is there any rsl or vex source for that shader.....? No, there isn't any freely available dipole based implementations that I am aware of. Quote Link to comment Share on other sites More sharing options...
kensonuken Posted December 15, 2008 Author Share Posted December 15, 2008 I got this from 3delight... I think the same logic should work for H as well.. // sssLightID.sl by Iosif Kefalas aka Sifis. tested on 3Delight 8.0.1 surface sssLightID( // DECLARE PARAMETERS #pragma annotation "grouping" "overall/overall_color;" #pragma annotation "grouping" "overall/overall_intensity;" color overall_color = 1; float overall_intensity = 1; #pragma annotation "grouping" "key/keyColor;" #pragma annotation "grouping" "key/key_intensity;" color keyColor = 1; float key_intensity = 1; #pragma annotation "grouping" "kick/kickColor;" #pragma annotation "grouping" "kick/kick_intensity;" color kickColor = 1; float kick_intensity = 1; #pragma annotation "grouping" "fill/fillColor;" #pragma annotation "grouping" "fill/fill_intensity;" color fillColor = 1; float fill_intensity = 1; // DECLARE OUTPUTS output varying color aov_sssLightID= 0; output varying color aov_sssLight_key= 0; output varying color aov_sssLight_kick= 0; output varying color aov_sssLight_fill= 0;) { float luminance(color input_color){ return 0.3 * comp(input_color, 0) + 0.59 * comp(input_color, 1) + 0.11 * comp(input_color, 2); } uniform string raytype = "unknown"; rayinfo("type", raytype); normal Nn = normalize(N); color keyLight = 0; color kickLight = 0; color fillLight = 0; uniform string category = ""; // SEND TO SUBSURFACE EACH LIGHT CATEGORY SEPERATELY if(raytype == "subsurface"){ illuminance(P, Nn, PI/2){ vector Ln = normalize(L); float lightContrib = Nn.Ln * luminance(Cl); lightsource("__category", category); if (category == "key,specular,diffuse" || category == "key") setcomp(Ci, 0, lightContrib * key_intensity); else if (category == "kick,specular,diffuse" || category == "kick") setcomp(Ci, 1, lightContrib * kick_intensity); else if (category == "fill,specular,diffuse" || category == "fill") setcomp(Ci, 2, lightContrib * fill_intensity); } Ci *= overall_color * overall_intensity; } // GET COLOR FROM EACH LIGHT CATEGORY SEPERATELY else{ illuminance(P, Nn, PI){ lightsource("__category", category); if (category == "key,specular,diffuse" || category == "key") keyLight = Cl; else if (category == "kick,specular,diffuse" || category == "kick") kickLight = Cl; else if (category == "fill,specular,diffuse" || category == "fill") fillLight = Cl; } // RETURN FROM SUBSURFACE EACH LIGHT CATEGORY SEPERATELY color sssReturn = subsurface(P); aov_sssLightID = color(sssReturn[0], sssReturn[1], sssReturn[2]); aov_sssLight_key = color(sssReturn[0], sssReturn[0], sssReturn[0]) * keyLight * keyColor; aov_sssLight_kick = color(sssReturn[1], sssReturn[1], sssReturn[1]) * kickLight * kickColor; aov_sssLight_fill = color(sssReturn[2], sssReturn[2], sssReturn[2]) * fillLight * fillColor; Ci = aov_sssLight_key + aov_sssLight_kick + aov_sssLight_fill; } } Quote Link to comment Share on other sites More sharing options...
Jason Posted December 15, 2008 Share Posted December 15, 2008 I'm interested to see what you come up with Kensonuken. Have you managed to covert it? ps. wrapping your code in CODEBOX /CODEBOX tags make it more readable. I'll do that for you now. Quote Link to comment Share on other sites More sharing options...
kensonuken Posted December 15, 2008 Author Share Posted December 15, 2008 (edited) here is the modified code.. // sssLightID.sl by Iosif Kefalas aka Sifis. tested on 3Delight 8.0.1 surface sssLightID( // DECLARE PARAMETERS #pragma annotation "grouping" "overall/overall_color;" #pragma annotation "grouping" "overall/overall_intensity;" color overall_color = 1; float overall_intensity = 1; #pragma annotation "grouping" "key/keyColor;" #pragma annotation "grouping" "key/key_intensity;" color keyColor = 1; float key_intensity = 1; #pragma annotation "grouping" "kick/kickColor;" #pragma annotation "grouping" "kick/kick_intensity;" color kickColor = 1; float kick_intensity = 1; #pragma annotation "grouping" "fill/fillColor;" #pragma annotation "grouping" "fill/fill_intensity;" color fillColor = 1; float fill_intensity = 1; // DECLARE OUTPUTS output varying color aov_sssLightID= 0; output varying color aov_sssLight_key= 0; output varying color aov_sssLight_kick= 0; output varying color aov_sssLight_fill= 0;) { float luminance(color input_color){ return 0.3 * comp(input_color, 0) + 0.59 * comp(input_color, 1) + 0.11 * comp(input_color, 2); } uniform string raytype = "unknown"; rayinfo("type", raytype); normal Nn = normalize(N); color keyLight = 0; color kickLight = 0; color fillLight = 0; uniform string category = ""; // SEND TO SUBSURFACE EACH LIGHT CATEGORY SEPERATELY if(raytype == "subsurface"){ illuminance(P, Nn, PI/2){ vector Ln = normalize(L); float lightContrib = Nn.Ln * luminance(Cl); lightsource("__category", category); if (category == "key,specular,diffuse" || category == "key") setcomp(Ci, 0, lightContrib * key_intensity); else if (category == "kick,specular,diffuse" || category == "kick") setcomp(Ci, 1, lightContrib * kick_intensity); else if (category == "fill,specular,diffuse" || category == "fill") setcomp(Ci, 2, lightContrib * fill_intensity); } Ci *= overall_color * overall_intensity; } // GET COLOR FROM EACH LIGHT CATEGORY SEPERATELY else{ // RETURN FROM SUBSURFACE EACH LIGHT CATEGORY SEPERATELY color sssReturn = subsurface(P); aov_sssLightID = color(sssReturn[0], sssReturn[1], sssReturn[2]); aov_sssLight_key = color(sssReturn[0]) * keyColor; aov_sssLight_kick = color(sssReturn[1]) * kickColor; aov_sssLight_fill = color(sssReturn[2]) * fillColor; Ci = aov_sssLight_key + aov_sssLight_kick + aov_sssLight_fill; } } Edited December 15, 2008 by kensonuken Quote Link to comment Share on other sites More sharing options...
kensonuken Posted December 15, 2008 Author Share Posted December 15, 2008 But It renders only in three images in three channels.... I think we need to have that complete code with Illum loop to solve this.. 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.