Normand Briere
2019-09-18 f9325048496d7cdbcad233f8a6b84c88e79adcc2
cMaterial.java
....@@ -34,13 +34,13 @@
3434 shadow = val;
3535 texture = val;
3636 opacity = val;
37
+ parallax = val;
3738 fakedepth = val;
3839 shadowbias = val;
3940 }
4041
4142 public cMaterial(cMaterial mat)
4243 {
43
- this();
4444 if (mat != null)
4545 {
4646 Set(mat);
....@@ -71,6 +71,7 @@
7171 shadow = mat.shadow;
7272 texture = mat.texture;
7373 opacity = mat.opacity;
74
+ parallax = mat.parallax;
7475 fakedepth = mat.fakedepth;
7576 shadowbias = mat.shadowbias;
7677
....@@ -79,7 +80,8 @@
7980
8081 void UpdateMaterial(cMaterial anchor, cMaterial current)
8182 {
82
- color *= Factor(anchor.color, current.color);
83
+ //color *= Factor(anchor.color, current.color);
84
+ color = current.color;
8385 //if (anchor.saturation == 0)
8486 // anchor.saturation = 0.001f;
8587 if (anchor.modulation == 0)
....@@ -104,16 +106,17 @@
104106 shadow *= Factor(anchor.shadow, current.shadow);
105107 texture *= Factor(anchor.texture, current.texture);
106108 opacity *= Factor(anchor.opacity, current.opacity);
109
+// if (anchor.parallax == 0)
110
+// anchor.parallax = 0.001f;
111
+ //parallax *= Factor(anchor.parallax, current.parallax);
112
+ parallax = current.parallax;
107113 fakedepth *= Factor(anchor.fakedepth, current.fakedepth);
108114 shadowbias *= Factor(anchor.shadowbias, current.shadowbias);
109115 }
110116
111117 float Factor(float anchor, float current)
112118 {
113
- if (anchor <= 0)
114
- {
115
- assert anchor > 0;
116
- }
119
+ Grafreed.Assert(anchor > 0);
117120
118121 return current / anchor;
119122 }
....@@ -358,11 +361,13 @@
358361 // }
359362
360363 float color = 0.5f, modulation /*SATURATION*/ = 0.001f, metalness = 0.001f;
361
- float diffuse = 0.75f, specular = 0.25f, shininess = 0.75f, shift = 1;
362
- float ambient = 0.001f, lightarea = 0.025f, factor = 0.001f, velvet = 0.001f;
364
+ float diffuse = 1f, specular = 0.25f, shininess = 0.75f, shift = 1;
365
+ float ambient = 0.001f, lightarea = 0.005f, factor = 0.001f, velvet = 0.001f;
363366 float sheen = 1f, subsurface = 0.001f, bump = 0.75f, aniso = 0.001f, anisoV = 0.001f;
364
- float cameralight = 0.2f, diffuseness = 0.001f, shadow = 5f, texture = 1f, opacity = 1;
367
+ float cameralight = 0.5f, diffuseness = 0.001f, shadow = 5f, texture = 1f, opacity = 1;
365368 float fakedepth = 0.5f, shadowbias = 0.01f; // 0.001f;
369
+
370
+ float parallax = 0;
366371
367372 boolean multiply;
368373