Fix dark spots in fullbright quad rendering.
Fix multi-layer model not declaring dependency on the particle texture.
Fix mistake in 2c054fca
which I didn't intend to push when I did.
This commit is contained in:
parent
c1840abb0a
commit
983a47a7d6
4 changed files with 17 additions and 12 deletions
|
@ -9,3 +9,12 @@
|
||||||
vector3f1.func_195901_a(0.0F, 1.0F);
|
vector3f1.func_195901_a(0.0F, 1.0F);
|
||||||
if (f2 > 0.0F) {
|
if (f2 > 0.0F) {
|
||||||
float f10 = Math.max(vector3f1.func_195899_a(), Math.max(vector3f1.func_195900_b(), vector3f1.func_195902_c()));
|
float f10 = Math.max(vector3f1.func_195899_a(), Math.max(vector3f1.func_195900_b(), vector3f1.func_195902_c()));
|
||||||
|
@@ -169,7 +171,7 @@
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int func_228450_a_(int p_228450_0_) {
|
||||||
|
- return p_228450_0_ >> 4 & '\uffff';
|
||||||
|
+ return (p_228450_0_ & 0xFFFF) >> 4; // Forge: Fix fullbright quads showing dark artifacts. Reported as MC-169806
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int func_228454_b_(int p_228454_0_) {
|
||||||
|
|
|
@ -70,6 +70,7 @@ public final class MultiLayerModel implements IModelGeometry<MultiLayerModel>
|
||||||
public Collection<Material> getTextures(IModelConfiguration owner, Function<ResourceLocation, IUnbakedModel> modelGetter, Set<Pair<String, String>> missingTextureErrors)
|
public Collection<Material> getTextures(IModelConfiguration owner, Function<ResourceLocation, IUnbakedModel> modelGetter, Set<Pair<String, String>> missingTextureErrors)
|
||||||
{
|
{
|
||||||
Set<Material> materials = Sets.newHashSet();
|
Set<Material> materials = Sets.newHashSet();
|
||||||
|
materials.add(owner.resolveTexture("particle"));
|
||||||
for (IUnbakedModel m : models.values())
|
for (IUnbakedModel m : models.values())
|
||||||
materials.addAll(m.func_225614_a_(modelGetter, missingTextureErrors));
|
materials.addAll(m.func_225614_a_(modelGetter, missingTextureErrors));
|
||||||
return materials;
|
return materials;
|
||||||
|
|
|
@ -366,16 +366,12 @@ public class OBJModel implements IMultipartModelGeometry<OBJModel>
|
||||||
|
|
||||||
builder.setQuadTint(tintIndex);
|
builder.setQuadTint(tintIndex);
|
||||||
|
|
||||||
boolean diffuse = true;
|
Vec2f uv2 = new Vec2f(0, 0);
|
||||||
|
|
||||||
Vec2f uv2 = new Vec2f(0,0);
|
|
||||||
if (ambientToFullbright)
|
if (ambientToFullbright)
|
||||||
{
|
{
|
||||||
int fakeLight = (int) ((ambientColor.getX() + ambientColor.getY() + ambientColor.getZ()) * 15 / 3.0f);
|
int fakeLight = (int) ((ambientColor.getX() + ambientColor.getY() + ambientColor.getZ()) * 15 / 3.0f);
|
||||||
uv2 = new Vec2f((fakeLight << 4) / 32767.0f, (fakeLight << 4) / 32767.0f);
|
uv2 = new Vec2f((fakeLight << 4) / 32767.0f, (fakeLight << 4) / 32767.0f);
|
||||||
//uv2 = new Vec2f(0, (fakeLight << 4) / 32767.0f);
|
builder.setApplyDiffuseLighting(fakeLight == 0);
|
||||||
//uv2 = new Vec2f((fakeLight << 4) / 32767.0f, 0);
|
|
||||||
builder.setApplyDiffuseLighting(diffuse = (fakeLight > 0));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean hasTransform = !transform.isIdentity();
|
boolean hasTransform = !transform.isIdentity();
|
||||||
|
@ -402,7 +398,6 @@ public class OBJModel implements IMultipartModelGeometry<OBJModel>
|
||||||
color.getY() * colorTint.getY(),
|
color.getY() * colorTint.getY(),
|
||||||
color.getZ() * colorTint.getZ(),
|
color.getZ() * colorTint.getZ(),
|
||||||
color.getW() * colorTint.getW());
|
color.getW() * colorTint.getW());
|
||||||
if (!diffuse) normal = new Vector3f(0,0,0);
|
|
||||||
putVertexData(builder, position, texCoord, normal, tintedColor, uv2, texture);
|
putVertexData(builder, position, texCoord, normal, tintedColor, uv2, texture);
|
||||||
pos[i] = position;
|
pos[i] = position;
|
||||||
norm[i] = normal;
|
norm[i] = normal;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
# Rhino
|
# Rhino
|
||||||
newmtl New material 001 (1)
|
newmtl New material 001 (1)
|
||||||
Ka 0.5 0.5 0.5
|
Ka 1 1 1
|
||||||
Kd 0.4588 0.3333 0.1882
|
Kd 0.4588 0.3333 0.1882
|
||||||
Ks 1.0000 1.0000 1.0000
|
Ks 1.0000 1.0000 1.0000
|
||||||
Tf 0.0000 0.0000 0.0000
|
Tf 0.0000 0.0000 0.0000
|
||||||
|
@ -9,7 +9,7 @@ Ns 0
|
||||||
map_Kd #qr
|
map_Kd #qr
|
||||||
|
|
||||||
newmtl New material 001
|
newmtl New material 001
|
||||||
Ka 0.5 0.5 0.5
|
Ka 1 1 1
|
||||||
Kd 0.6745 0.5216 0.3412
|
Kd 0.6745 0.5216 0.3412
|
||||||
Ks 1.0000 1.0000 1.0000
|
Ks 1.0000 1.0000 1.0000
|
||||||
Tf 0.0000 0.0000 0.0000
|
Tf 0.0000 0.0000 0.0000
|
||||||
|
@ -18,7 +18,7 @@ Ns 0
|
||||||
map_Kd #qr
|
map_Kd #qr
|
||||||
|
|
||||||
newmtl Default
|
newmtl Default
|
||||||
Ka 0.5 0.5 0.5
|
Ka 1 1 1
|
||||||
Kd 1.0000 1.0000 1.0000
|
Kd 1.0000 1.0000 1.0000
|
||||||
Ks 1.0000 1.0000 1.0000
|
Ks 1.0000 1.0000 1.0000
|
||||||
Tf 0.0000 0.0000 0.0000
|
Tf 0.0000 0.0000 0.0000
|
||||||
|
@ -27,7 +27,7 @@ Ns 0
|
||||||
map_Kd #qr
|
map_Kd #qr
|
||||||
|
|
||||||
newmtl New material 002
|
newmtl New material 002
|
||||||
Ka 0.5 0.5 0.5
|
Ka 1 1 1
|
||||||
Kd 0.4118 0.4118 0.4118
|
Kd 0.4118 0.4118 0.4118
|
||||||
Ks 1.0000 1.0000 1.0000
|
Ks 1.0000 1.0000 1.0000
|
||||||
Tf 0.0000 0.0000 0.0000
|
Tf 0.0000 0.0000 0.0000
|
||||||
|
@ -36,7 +36,7 @@ Ns 0
|
||||||
map_Kd #qr
|
map_Kd #qr
|
||||||
|
|
||||||
newmtl New material 003
|
newmtl New material 003
|
||||||
Ka 0.5 0.5 0.5
|
Ka 1 1 1
|
||||||
Kd 0.1490 0.1490 0.1490
|
Kd 0.1490 0.1490 0.1490
|
||||||
Ks 1.0000 1.0000 1.0000
|
Ks 1.0000 1.0000 1.0000
|
||||||
Tf 0.0000 0.0000 0.0000
|
Tf 0.0000 0.0000 0.0000
|
||||||
|
|
Loading…
Reference in a new issue