コード例 #1
0
 void SetCommonUniforms(UniformsData uniforms)
 {
     uniforms.Set("param_offsetFromPlanetCenter", RendererSurface.Offset.ToVector3d());
     uniforms.Set("param_remainderOffset", RendererSurface.Offset.Remainder());
     uniforms.Set("param_generation", subdivisionDepth);
     uniforms.Set("param_segmentId", (int)this.ID);
     uniforms.Set("param_segmentNormalMap", segmentNormalMap);
 }
コード例 #2
0
        public void SetTo(UniformsData uniforms)
        {
            uniforms.Set("param_radiusMin", (double)radiusMin);
            uniforms.Set("param_noiseHeightMultiplier", (double)noiseHeightMultiplier);
            uniforms.Set("param_noisePositionMultiplier", (double)noisePositionMultiplier);
            uniforms.Set("param_seaLevel01", (double)seaLevel01);


            uniforms.Set("param_biomesControlMap", biomesControlMap);

            foreach (var biome in biomes)
            {
                var splatMapTextureId      = (biome.Key / 4.0).FloorToInt();
                var splatMapTextureChannel = biome.Key % 4;

                var channel = new string[] { "r", "g", "b", "a" }[splatMapTextureChannel];
                splatMapTextureId += 1;
                uniforms.Set("param_biome" + splatMapTextureId + "" + channel + "_diffuseMap", biome.Value.diffuse);
                uniforms.Set("param_biome" + splatMapTextureId + "" + channel + "_normalMap", biome.Value.normal);
                uniforms.Set("param_biome" + splatMapTextureId + "" + channel + "_color", biome.Value.VectorColor);
            }
        }