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
....@@ -105,16 +106,17 @@
105106 shadow *= Factor(anchor.shadow, current.shadow);
106107 texture *= Factor(anchor.texture, current.texture);
107108 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;
108113 fakedepth *= Factor(anchor.fakedepth, current.fakedepth);
109114 shadowbias *= Factor(anchor.shadowbias, current.shadowbias);
110115 }
111116
112117 float Factor(float anchor, float current)
113118 {
114
- if (anchor <= 0)
115
- {
116
- assert anchor > 0;
117
- }
119
+ Grafreed.Assert(anchor > 0);
118120
119121 return current / anchor;
120122 }
....@@ -359,11 +361,13 @@
359361 // }
360362
361363 float color = 0.5f, modulation /*SATURATION*/ = 0.001f, metalness = 0.001f;
362
- float diffuse = 0.75f, specular = 0.25f, shininess = 0.75f, shift = 1;
363
- 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;
364366 float sheen = 1f, subsurface = 0.001f, bump = 0.75f, aniso = 0.001f, anisoV = 0.001f;
365
- 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;
366368 float fakedepth = 0.5f, shadowbias = 0.01f; // 0.001f;
369
+
370
+ float parallax = 0;
367371
368372 boolean multiply;
369373