Announcement

Collapse
No announcement yet.

Vray AppSdk setting for production rendering

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Vray AppSdk setting for production rendering

    Hi , I am having problem with VRay.RenderMode.PRODUCTION; it is taking a long duration to render the scene. 1% render in 2 hrours.
    when i am using VRay.RenderMode.PRODUCTION_CUDA; it render nicely fast render and good quality and can be seen in the uploaded image.
    So, anyone please help to understand the setting for the VRay.RenderMode.PRODUCTION;


    Code which I am using for both rendering modes but not working for VRay.RenderMode.PRODUCTION

    namespace _10_plugin_filter
    {
    public class Settings
    {

    public static void SettingsColorMapping(VRayRenderer renderer)
    {

    InfoRenderEngine infoRenderEngine = renderer.GetInstanceOrCreate<InfoRenderEngine>("in foRenderEngine");
    infoRenderEngine.EngineType = "cuda";

    SettingsRTEngine settingsRTEngine = renderer.GetInstanceOrCreate<SettingsRTEngine>("rt Engine_settings");
    settingsRTEngine.TraceDepth = 5;
    settingsRTEngine.GiDepth = 3;
    settingsRTEngine.CpuBundleSize = 128;
    settingsRTEngine.CpuSamplesPerPixel = 4;
    settingsRTEngine.GpuBundleSize = 192;
    settingsRTEngine.LowGpuThreadPriority = false;
    settingsRTEngine.CoherentTracing = false;
    settingsRTEngine.StereoMode = false;
    settingsRTEngine.StereoEyeDistance = 6.5f;
    settingsRTEngine.StereoFocus = 2;
    settingsRTEngine.OpenclTexsize = 512;
    settingsRTEngine.OpenclResizeTextures = 0;
    settingsRTEngine.OpenclTextureFormat = 2;
    settingsRTEngine.ProgressiveSamplesPerPixel = true;
    settingsRTEngine.Undersampling = 2;
    settingsRTEngine.DisableRenderElements = false;
    settingsRTEngine.MaxRenderTime = 0;
    settingsRTEngine.MaxSampleLevel = 256;
    settingsRTEngine.NoiseThreshold = 0.001f;
    settingsRTEngine.EnableMask = false;
    settingsRTEngine.MaxDrawInterval = 150;
    settingsRTEngine.MinDrawInterval = 50;
    settingsRTEngine.Interactive = 0;
    settingsRTEngine.EnableCpuInterop = 0;
    settingsRTEngine.EnableBucketSampler = 0;

    SettingsEXR settingsEXR = renderer.NewPlugin<SettingsEXR>();
    settingsEXR.BitsPerChannel = 16;

    SettingsColorMapping colorMapping = renderer.GetInstanceOrCreate<SettingsColorMapping> ();
    colorMapping.SettingsColorMappingType = 6;
    colorMapping.Gamma = 1.0f;
    //colorMapping.LinearWorkflow = true;
    colorMapping.AdaptationOnly = 0;
    colorMapping.AffectBackground = true;
    colorMapping.DarkMult = 1;
    colorMapping.BrightMult = 500;
    colorMapping.SubpixelMapping = false;
    colorMapping.ClampOutput = false;
    colorMapping.ClampLevel = 1;

    }

    public static void SettingGI(VRayRenderer renderer)
    {

    SettingsGI gi = renderer.GetInstanceOrCreate<SettingsGI>();

    gi.On = true;
    gi.PrimaryEngine = 0;
    gi.PrimaryMultiplier = 1;
    gi.ReflectCaustics = true;
    gi.RefractCaustics = true;
    gi.SecondaryEngine = 3;
    gi.SecondaryMultiplier = 1;
    gi.RayDistanceOn = false;
    gi.RayDistance = 100;
    gi.AoOn = true;
    gi.AoSubdivs = 500;
    gi.AoRadius = 1f;
    gi.AoAmount = 100;
    gi.Contrast = 1;
    gi.ContrastBase = 0.5f;
    gi.Saturation = 1;

    SettingsIrradianceMap settingsIrradianceMap = renderer.NewPlugin<SettingsIrradianceMap>();
    settingsIrradianceMap.MinRate = -4;
    settingsIrradianceMap.MaxRate = -3;
    settingsIrradianceMap.Subdivs = 30;
    settingsIrradianceMap.InterpSamples = 20;
    settingsIrradianceMap.CalcInterpSamples = 15;
    settingsIrradianceMap.InterpFrames = 2;
    settingsIrradianceMap.ColorThreshold = 0.4f;
    settingsIrradianceMap.NormalThreshold = 0.3f;
    settingsIrradianceMap.DistanceThreshold = 0.1f;
    settingsIrradianceMap.DetailEnhancement = false;
    settingsIrradianceMap.DetailRadius = 60;
    settingsIrradianceMap.DetailSubdivsMult = 0.3f;
    settingsIrradianceMap.DetailScale = 0;
    settingsIrradianceMap.RandomizeSamples = true;
    settingsIrradianceMap.InterpolationMode = 1;
    settingsIrradianceMap.LookupMode = 3;
    settingsIrradianceMap.Mode = 5;
    settingsIrradianceMap.DontDelete = true;
    settingsIrradianceMap.ShowSamples = false;
    settingsIrradianceMap.ShowCalcPhase = true;
    settingsIrradianceMap.ShowDirectLight = false;
    settingsIrradianceMap.MultipleViews = false;
    settingsIrradianceMap.Multipass = true;
    settingsIrradianceMap.CheckSampleVisibility = false;
    settingsIrradianceMap.AutoSave = true;
    settingsIrradianceMap.AutoSaveFile = "";


    SettingsLightCache settingsLightCache = renderer.NewPlugin<SettingsLightCache>();
    settingsLightCache.Subdivs = 2048;
    settingsLightCache.SampleSize = 0.01f;
    settingsLightCache.FilterType = 1;
    settingsLightCache.FilterSamples = 5;
    settingsLightCache.FilterSize = 0.02f;
    settingsLightCache.Prefilter = true;
    settingsLightCache.PrefilterSamples = 40;
    settingsLightCache.Depth = 100;
    settingsLightCache.ShowCalcPhase = true;
    settingsLightCache.StoreDirectLight = true;
    settingsLightCache.Mode = 0;
    settingsLightCache.DontDelete = true;
    settingsLightCache.AutoSave = false;
    settingsLightCache.AutoSaveFile = "";
    settingsLightCache.NumPasses = 64;
    settingsLightCache.UseForGlossyRays = true;
    settingsLightCache.AdaptiveSampling = false;
    settingsLightCache.WorldScale = false;
    settingsLightCache.Premultiplied = true;
    settingsLightCache.MultipleViews = false;
    settingsLightCache.RetraceEnabled = true;
    settingsLightCache.RetraceThreshold = 2.0f;
    settingsLightCache.RetraceLeakPrevention = 0.8f;
    }

    public static void SettingAdapDMC(VRayRenderer renderer)
    {
    SettingsPhotonMap settingsPhotonMap = renderer.NewPlugin<SettingsPhotonMap>();
    settingsPhotonMap.Bounces = 30;
    settingsPhotonMap.MaxPhotons = 3000;
    settingsPhotonMap.Prefilter = true;
    settingsPhotonMap.PrefilterSamples = 10;
    settingsPhotonMap.Mode = 0;
    //settingsPhotonMap.File = "";
    settingsPhotonMap.AutoSearchDistance = true;
    //settingsPhotonMap.SearchDistance = 20;
    settingsPhotonMap.DontDelete = true;
    settingsPhotonMap.AutoSave = false;
    settingsPhotonMap.AutoSaveFile = "";
    settingsPhotonMap.StoreDirectLight = true;
    settingsPhotonMap.Multiplier = 10;
    settingsPhotonMap.MaxDensity = 10; ;
    settingsPhotonMap.RetraceCorners = 500;
    settingsPhotonMap.RetraceBounces = 500;
    settingsPhotonMap.ShowCalcPhase = false;
    }

    public static void SettingProgSamlpr(VRayRenderer renderer)
    {
    SettingsImageSampler imageSampler = renderer.GetInstanceOrCreate<SettingsImageSampler> ();

    imageSampler.SettingsImageSamplerType = 1;

    imageSampler.DmcThreshold = 0.01F;

    imageSampler.ProgressiveMaxTime = 0;
    imageSampler.FixedSubdivs = 64;
    imageSampler.DmcMinSubdivs = 64;
    imageSampler.DmcMaxSubdivs = 512;
    imageSampler.MinShadeRate = 32;
    imageSampler.DmcThreshold = 0.005f;
    imageSampler.SubdivisionMinRate = -1;
    imageSampler.SubdivisionMaxRate = 2;
    imageSampler.SubdivisionJitter = true;
    imageSampler.SubdivisionThreshold = 0.1f;
    imageSampler.SubdivisionEdges = false;
    imageSampler.SubdivisionNormals = false;
    imageSampler.SubdivisionNormalsThreshold = 0.05f;
    imageSampler.ProgressiveMinSubdivs = 1;
    imageSampler.ProgressiveMaxSubdivs = 512;
    imageSampler.ProgressiveThreshold = 0.001f;
    imageSampler.ProgressiveMaxTime = 0;
    imageSampler.ProgressiveBundleSize = 128;
    imageSampler.ProgressiveShowMask = false;
    imageSampler.ProgressiveProgNoiseThreshold = 80;
    imageSampler.ProgressiveEffectsUpdate = 10;
    imageSampler.RenderMaskMode = 0;
    imageSampler.ProgressiveProgNoiseThreshold = 80;
    imageSampler.RenderMaskClear = 0;
    imageSampler.RenderMaskMode = 0;
    imageSampler.ProgressiveAutoswitchEffectsresult = true;

    SettingsDMCSampler settingsDMCSampler = renderer.NewPlugin<SettingsDMCSampler>();
    settingsDMCSampler.TimeDependent = true;
    settingsDMCSampler.AdaptiveThreshold = 0.005f;
    settingsDMCSampler.AdaptiveMinSamples = 64;
    settingsDMCSampler.SubdivsMult = 1;
    settingsDMCSampler.PathSamplerType = 2;
    settingsDMCSampler.DivShadeSubdivs = true;
    settingsDMCSampler.UseLocalSubdivs = true;
    settingsDMCSampler.AdaptiveAmount = 0.850f;
    settingsDMCSampler.AdaptiveMinSamples = 500;

    SettingsDMCGI settingsDMCGI = renderer.NewPlugin<SettingsDMCGI>();
    settingsDMCGI.Subdivs = 2048;
    settingsDMCGI.Depth = 2048;
    }

    public static void SettingAntiAlias(VRayRenderer renderer)
    {
    FilterLanczos filter = renderer.GetInstanceOrCreate<FilterLanczos>();
    filter.Size = 2.0f;
    }


    public static void CameraSettings(VRayRenderer renderer,UnityData unityData)
    {

    float camposX = unityData.cameraTrans.CamposX;
    float camposZ = unityData.cameraTrans.CamposZ - 0.1f;
    float camposY = unityData.cameraTrans.CamposY;
    float camrotX = unityData.cameraTrans.CamrotX;
    float camrotZ = unityData.cameraTrans.CamrotZ;
    float camrotY = unityData.cameraTrans.CamrotY;

    Matrix mx = Matrix.MakeRotationMatrixX(Mathf.Deg2Rad * -camrotX);
    Matrix my = Matrix.MakeRotationMatrixY(Mathf.Deg2Rad * -camrotY);
    Matrix mz = Matrix.MakeRotationMatrixZ(Mathf.Deg2Rad * 0);

    RenderView renderView = renderer.NewPlugin<RenderView>("renderView");
    renderView.Transform = new VRay.Transform(mz * my * mx, new Vector(camposX, camposY, -camposZ));



    if (unityData.cameraTrans.isPano)
    {
    renderView.Fov = 6.283185f;
    renderView.Orthographic = false;
    renderView.OrthographicWidth = 30;
    renderView.MayaFocalLength = 12;
    renderView.MayaApperture = 1.41732f;
    renderView.FrameSamples = 2;
    renderView.Clipping = false;
    renderView.ClippingNear = 0.1f;
    renderView.ClippingFar = 10000;
    renderView.Zoom = 1;

    SettingsCamera settingsCamera = renderer.GetInstanceOrCreate<SettingsCamera>();
    settingsCamera.SettingsCameraType = 9;
    settingsCamera.Height = 180;
    settingsCamera.Fov = -1;
    settingsCamera.Dist = 2;
    settingsCamera.AutoFit = true;
    settingsCamera.Curve = 1;
    settingsCamera.AutoCorrectionsMode = 1;
    settingsCamera.AutoExposure = true;
    settingsCamera.AutoWhiteBalance = 1;
    settingsCamera.AutoExposureCompensation = -1;
    }
    else
    {
    SettingsCamera settingsCamera = renderer.GetInstanceOrCreate<SettingsCamera>();
    settingsCamera.SettingsCameraType = 0;
    settingsCamera.Dist = 2;
    settingsCamera.AutoFit = false;
    settingsCamera.Curve = 1;
    settingsCamera.AutoCorrectionsMode = 0;
    settingsCamera.AutoExposure = true;
    settingsCamera.AutoWhiteBalance = 2;
    settingsCamera.AutoExposureCompensation = 1.0f;

    float aspectRatio = unityData.cameraTrans.aspectRatio;
    float UnityFov = unityData.cameraTrans.UnityFov;
    UnityFov = Mathf.Deg2Rad * UnityFov;
    float HFov = 2 * Mathf.Atan(aspectRatio * Mathf.Tan(UnityFov / 2));
    renderView.Fov = HFov;
    //camera.Fov = HFov;
    }
    }
    }
    }


    Thanks You

  • #2
    Hi,

    I'm very sorry for the late response.
    settingsDMCGI.Depth = 2048;
    seems to be too high. Try reducing the value. The range from the UI guides is from 1 до 500.

    Best regards,
    Stan

    Comment

    Working...
    X