Announcement

Collapse
No announcement yet.

vrscene file format: Declaration of variables

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

  • vrscene file format: Declaration of variables

    Hi,
    is there a possibility to declare variables in the vrscene file format?

    What I already know is that you can store an aColor value inside a TexBlend element that can be (ab-) used as some sort of variable.

    Like so:

    Code:
    TexBlend [COLOR="blue"]colorChooser [/COLOR]{
      color_a=AColor(1.0, 0.0, 0.0);
      blend_amount =0;
    }
    And the colorChooser can be used in the code to substitute an AColor value say for the color_tex of a diffuse material.

    Like so:

    Code:
    BRDFDiffuse diffuse_component {
      transparency_tex=AColor(0, 0, 0, 1);
      color_tex=[COLOR="blue"]colorChooser[/COLOR];
      color=Color(0, 0, 0); 
      roughness=0;
      use_irradiance_map=1;
    }
    Is there any possibility to do the same thing for Color and other elements
    i.e. store the 1.5 of

    color_mult=1.5;

    in such a variable?

    Thanks in advance

    Scyla

  • #2
    Not sure if this is what you need, but you can declare a dummy object with the necessary properties, for example:
    Code:
    Dummy params {
      some_number=0.5;
      some_color=Color(0.6, 0.7, 0.8);
    }
    
    BRDFDiffuse diffuse {
      color=params.some_color; // Same as Color(0.6, 0.7, 0.8)
      color_tex_mult=params.some_number; // Will use 0.5
    }
    V-Ray will print a warning that it cannot find a plugin type "Dummy", but other than that, it will work fine.

    You can also specify parameters of other plugins in this way (e.g. you can link the color of one texture to the parameter value of another texture etc.

    Best regards,
    Vlado
    I only act like I know everything, Rogers.

    Comment


    • #3
      Thank you very much for the quick response vlado!

      I will test it right away.

      Comment


      • #4
        Works perferctly.

        Thanks again!

        Comment


        • #5
          Vlado,

          In Scyla's example:

          Code:
          BRDFDiffuse diffuse_component {
            transparency_tex=AColor(0, 0, 0, 1);
            color_tex=[COLOR="#4169e1"]colorChooser[/COLOR];
            color=Color(0, 0, 0); 
            roughness=0;
            use_irradiance_map=1;
          }
          Why does Vray not complain that there is no parameter defined to map from colorChooser? I know it works, I just dont know why.

          Comment


          • #6
            "color_tex" is a texture parameter, which is evaluated during shading, while "color" is a simple color that stays the same during a single frame. When you assign a texture plugin to the "color_tex" parameter, V-Ray knows that this is a texture object and it knows how to extract the color from it. That's why there is no need to specify a parameter explicitly.

            Best regards,
            Vlado
            I only act like I know everything, Rogers.

            Comment

            Working...
            X