Advertisement
snake5

sgrx sample editable struct

Apr 13th, 2016
398
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 3.32 KB | None | 0 0
  1. //// struct ////
  2. struct EdWorldLightingInfo
  3. {
  4.     EdWorldLightingInfo()
  5.     {
  6.         ambientColor = V3(0,0,0.1f);
  7.         dirLightDir = V2(0);
  8.         dirLightColor = V3(0);
  9.         dirLightDvg = 10;
  10.         dirLightNumSamples = 15;
  11.         lightmapClearColor = V3(0);
  12.     //  radNumBounces = 2;
  13.         lightmapDetail = 2;
  14.         lightmapBlurSize = 1;
  15.         aoDist = 2;
  16.         aoMult = 1;
  17.         aoFalloff = 2;
  18.         aoEffect = 0;
  19.     //  aoDivergence = 0;
  20.         aoColor = V3(0);
  21.         aoNumSamples = 15;
  22.         sampleDensity = 1.0f;
  23.     }
  24.    
  25.     Vec3 ambientColor;
  26.     Vec2 dirLightDir;
  27.     Vec3 dirLightColor;
  28.     float dirLightDvg;
  29.     int32_t dirLightNumSamples;
  30.     Vec3 lightmapClearColor;
  31. //  int32_t radNumBounces;
  32.     float lightmapDetail;
  33.     float lightmapBlurSize;
  34.     float aoDist;
  35.     float aoMult;
  36.     float aoFalloff;
  37.     float aoEffect;
  38. //  float aoDivergence;
  39.     Vec3 aoColor;
  40.     int32_t aoNumSamples;
  41.     float sampleDensity;
  42.     String skyboxTexture;
  43.     String clutTexture;
  44. };
  45.  
  46. //// metadata script ////
  47. function MD_VEC2( x, y )
  48. {
  49.     return fmt_pack( "2f", x, y ?? x );
  50. }
  51. function MD_VEC3( x, y, z )
  52. {
  53.     return fmt_pack( "3f", x, y ?? x, z ?? x );
  54. }
  55. STRUCT("EdWorldLightingInfo",
  56. {
  57.     metadata = { label = "Lighting info" },
  58.     props =
  59.     [
  60.         { name = "ambientColor", type = "Vec3", metadata = { label = "Ambient color", min = MD_VEC3(0,0,0), max = MD_VEC3(1,1,100) } },
  61.         { name = "dirLightDir", type = "Vec2", metadata = { label = "Dir.light direction (dX,dY)", min = MD_VEC2(-8192), max = MD_VEC2(8192) } },
  62.         { name = "dirLightColor", type = "Vec3", metadata = { label = "Dir.light color (HSV)", min = MD_VEC3(0,0,0), max = MD_VEC3(1,1,100) } },
  63.         { name = "dirLightDvg", type = "float", metadata = { label = "Dir.light divergence", min = 0, max = 180 } },
  64.         { name = "dirLightNumSamples", type = "int32_t", metadata = { label = "Dir.light sample count", min = 0, max = 256 } },
  65.         { name = "lightmapClearColor", type = "Vec3", metadata = { label = "Lightmap clear color (HSV)", min = MD_VEC3(0,0,0), max = MD_VEC3(1,1,100) } },
  66.     //  { name = "radNumBounces", type = "int32_t", metadata = { label = "Radiosity bounce count", min = 0, max = 256 } },
  67.         { name = "lightmapDetail", type = "float", metadata = { label = "Lightmap detail", min = 0.01, max = 16 } },
  68.         { name = "lightmapBlurSize", type = "float", metadata = { label = "Lightmap blur size", min = 0, max = 10 } },
  69.         { name = "aoDist", type = "float", metadata = { label = "AO distance", min = 0, max = 100 } },
  70.         { name = "aoMult", type = "float", metadata = { label = "AO multiplier", min = 0, max = 2 } },
  71.         { name = "aoFalloff", type = "float", metadata = { label = "AO falloff", min = 0.01, max = 100.0 } },
  72.         { name = "aoEffect", type = "float", metadata = { label = "AO effect", min = -1, max = 1 } },
  73.     //  { name = "aoDivergence", type = "float", metadata = { label = "AO divergence", min = 0, max = 1 } },
  74.         { name = "aoColor", type = "Vec3", metadata = { label = "AO color (HSV)", min = MD_VEC3(0,0,0), max = MD_VEC3(1,1,100) } },
  75.         { name = "aoNumSamples", type = "int32_t", metadata = { label = "AO sample count", min = 0, max = 256 } },
  76.         { name = "sampleDensity", type = "float", metadata = { label = "Sample density", min = 0.01, max = 100.0 } },
  77.         { name = "skyboxTexture", type = "String", metadata = { label = "Skybox texture", edit = "texture" } },
  78.         { name = "clutTexture", type = "String", metadata = { label = "Default post-process cLUT", edit = "texture" } },
  79.     ],
  80. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement