MStatus OccLightNode::initialize_shader_parameters() { //CM_TRACE_FUNC("OccLightNode::initialize_shader_parameters()"); MFnTypedAttribute tAttr; MFnStringData tDefault; MFnNumericAttribute nAttr; MFnEnumAttribute eAttr; MFnLightDataAttribute lAttr; MFnStringData stringData; MStatus status, sstat; CREATE_FLOAT(nAttr, akocc, "Kocc", "k", 1.0); CREATE_INT(nAttr, asamples, "samples", "sam", 64); CREATE_FLOAT(nAttr, amaxdist, "maxdist", "max", 1e36); CREATE_STRING(tAttr,adistribution, "distribution", "dis", "cosine"); CREATE_BOOL(nAttr, a__nonspecular, "__nonspecular","nsp", 1); IfMErrorWarn( attributeAffects( akocc, aOutColor ) ); IfMErrorWarn( attributeAffects( asamples, aOutColor ) ); IfMErrorWarn( attributeAffects( amaxdist, aOutColor ) ); IfMErrorWarn( attributeAffects( adistribution, aOutColor ) ); IfMErrorWarn( attributeAffects( a__nonspecular, aOutColor ) ); return MS::kSuccess; }
MStatus PhysicalsunNode::initialize_shader_parameters() { //CM_TRACE_FUNC("PhysicalsunNode::initialize_shader_parameters()"); MFnTypedAttribute tAttr; MFnStringData tDefault; MFnNumericAttribute nAttr; MFnEnumAttribute eAttr; MFnLightDataAttribute lAttr; MFnStringData stringData; MStatus status, sstat; CREATE_FLOAT(nAttr, ai_multiplier, "multiplier", "mul", 1.0); CREATE_COLOR(nAttr, ai_rgb_unit_conversion, "rgb_unit_conversion", "uc", 0.0, 0.0, 0.0); CREATE_FLOAT(nAttr, ai_haze, "haze", "haz", 0.0); CREATE_FLOAT(nAttr, ai_redblueshift, "redblueshift", "rbs", 0.0); CREATE_FLOAT(nAttr, ai_saturation, "saturation", "sat", 0.7); CREATE_FLOAT(nAttr, ai_horizon_height, "horizon_height", "hoh", 0.0); CREATE_FLOAT(nAttr, ai_shadow_softness, "shadow_softness","ssf", 0.0); CREATE_STRING(tAttr,ai_shadowmap, "shadowmap", "sm", "raytrace"); CREATE_INT(nAttr, ai_shadow_samples, "shadow_samples", "ssp", 3); CREATE_BOOL(nAttr, ai_y_is_up, "y_is_up", "yup", false ); IfMErrorWarn( attributeAffects( ai_multiplier, aOutColor ) ); IfMErrorWarn( attributeAffects( ai_rgb_unit_conversion, aOutColor ) ); IfMErrorWarn( attributeAffects( ai_haze, aOutColor ) ); IfMErrorWarn( attributeAffects( ai_redblueshift, aOutColor ) ); IfMErrorWarn( attributeAffects( ai_saturation, aOutColor ) ); IfMErrorWarn( attributeAffects( ai_horizon_height, aOutColor ) ); IfMErrorWarn( attributeAffects( ai_shadow_softness, aOutColor ) ); IfMErrorWarn( attributeAffects( ai_shadowmap, aOutColor ) ); IfMErrorWarn( attributeAffects( ai_shadow_samples, aOutColor ) ); IfMErrorWarn( attributeAffects( ai_y_is_up, aOutColor ) ); return MS::kSuccess; }
MStatus TestLightNode::initialize_shader_parameters() { //CM_TRACE_FUNC("TestLightNode::initialize_shader_parameters()"); MFnTypedAttribute tAttr; MFnStringData tDefault; MFnNumericAttribute nAttr; MFnEnumAttribute eAttr; MFnLightDataAttribute lAttr; MStatus status; CREATE_COLOR(nAttr, alightcolor, "lightcolor", "lc", 1.0f, 1.0f, 1.0f); CREATE_FLOAT(nAttr, aintensity, "intensity", "its", 1.0f); IfMErrorWarn( attributeAffects( alightcolor, aOutColor ) ); IfMErrorWarn( attributeAffects( aintensity, aOutColor ) ); return MS::kSuccess; }
void orc_array_set_pattern (OrcArray *array, int value) { memset (array->alloc_data, value, array->alloc_len); } void orc_array_set_random (OrcArray *array, OrcRandomContext *context) { orc_random_bits (context, array->alloc_data, array->alloc_len); } #define CREATE_FLOAT(sign,exp,mant) (((sign)<<31)|((exp)<<23)|((mant)<<0)) static const orc_uint32 special_floats[] = { CREATE_FLOAT(0,0,0), /* 0 */ CREATE_FLOAT(1,0,0), /* -0 */ CREATE_FLOAT(0,126,0), /* 0.5 */ CREATE_FLOAT(0,127,0), /* 1 */ CREATE_FLOAT(0,128,0), /* 2 */ CREATE_FLOAT(1,126,0), /* -0.5 */ CREATE_FLOAT(1,127,0), /* -1 */ CREATE_FLOAT(1,128,0), /* -2 */ CREATE_FLOAT(0,255,0), /* infinity */ CREATE_FLOAT(1,255,0), /* -infinity */ CREATE_FLOAT(0,255,1), /* nan */ CREATE_FLOAT(1,255,1), /* -nan */ CREATE_FLOAT(0,0,1), /* denormal */ CREATE_FLOAT(1,0,1), /* -denormal */ CREATE_FLOAT(0,127+31,0), /* MAX_INT+1 */ CREATE_FLOAT(0,127+30,0x7fffff), /* largest float < MAX_INT */