• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[General] help

Status
Not open for further replies.
Level 2
Joined
Jul 10, 2012
Messages
12
So..I don't know why but the shadow of the unit is above the unit.
Can someone tell me what is the problem?

Image Updated:This is what I mean by saying the shadow above the unit.

Left side:If you look carefully,there is a very thin black line,that's the shadow of the unit.Cliff level is 2. I can confirm that.

Right side:There are no thin black line because I am using the cliff terrain and raise it to cliff level 5.

219762-albums8380-picture100939.jpg


PS: I tried to adjust the art-shadow image x,y,height and width,not solving the problem.
 

Attachments

  • My RPG v1.0 remake 14082015.w3x
    512.6 KB · Views: 51
Last edited:
Level 11
Joined
Jan 23, 2015
Messages
788
Go to the Object Editor, find the unit and adjust it's shadow at

Art - Shadow Image - Center X
Art - Shadow Image - Center Y
Art - Shadow Image - Height
Art - Shadow Image - Width

I assume that it's a custom unit, if so, go to the unit using this model (rock golem I guess?) and copy the values of the fields above, if it's a different size, then adjust the Height and Width on your own, but make sure you give them a same value e.g. Height 140, Width 140.
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
Shadows are not bound to a unit's model.
Shadows of a unit are just a dark filter on the ground placed at a certain displacement from the units origin.
In the object editor of that unit, you can find a few shadow settings under the Art category.

A few of those are these:
Art - Shadow Image - Center X
Art - Shadow Image - Center Y
Art - Shadow Image - Height
Art - Shadow Image - Width

The Center X and Center Y are the displacement (I suppose from the units origin but could be anything else. Be aware that this is the lower left (probably) corner of the image. Just try some stuff with it until you know what to do).

The Height and Width are pretty simple. Just change them until they look realistic compared to the unit.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
So..I don't know why but the shadow of the unit is above the unit.
From the looks of the image the shadow is "North" of the unit and not "above". This would be an incorrectly set "Art - Shadow Image - Center Y" field in the unit object type entry. Adjust it until the shadow is appropriately positioned so that it touches the unit feet and stretches North East of the unit.
 
Last edited:

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
Seen this before. It also applies to targeting overlays in that terrain area.

Not sure what the cause is but I believe it is the result of the water mesh layer. If you send me the map (or the w3e file in it) I can try to investigate further what is wrong with the terrain in that area.
 
Level 2
Joined
Jul 10, 2012
Messages
12
Seen this before. It also applies to targeting overlays in that terrain area.

Not sure what the cause is but I believe it is the result of the water mesh layer. If you send me the map (or the w3e file in it) I can try to investigate further what is wrong with the terrain in that area.
If you want, I can pm you my map with it.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
Water mesh was above ground mesh. Result is all overlays (targeting and shadow) float above the ground. Just because water flag is disabled does not mean the mesh is not there.

I re-computed the water mesh for the entire map to be -0.25 normalized units below the ground mesh. I cannot guarantee that the problem is completely fixed (or that parts of the map are not broken as a result) everywhere but some rough tests could not re-create the problem anymore.

This is what the water mesh looked like before applying height clamp.
attachment.php

This is the one I generated.
attachment.php

This JAVA code was used in combination with my W3E API to produce the new water mesh.
Code:
		System.out.println("performing transfrom");
		terrain.simpleTransform(V -> {
			double egh = TerrainVertex.convertHeightVertexToNormalized(V.getGroundHeight()) + V.getCliffLevel() - 2;
			double ewh = TerrainVertex.convertHeightVertexToNormalized(V.getWaterHeight()) - 0.7;
			if( ewh > egh ) V.setWaterHeight(TerrainVertex.convertHeightNormalizedToVertex(egh + 0.7 - 0.25));
		});

Darker means lower and you can see that a lot has been lowered.
 

Attachments

  • alexanderlow00 - My RPG v1.0 remake 14082015 - fix.w3x
    517.8 KB · Views: 37
  • war3map - after.png
    war3map - after.png
    5.7 KB · Views: 109
  • war3map - before.png
    war3map - before.png
    552 bytes · Views: 110
Level 2
Joined
Jul 10, 2012
Messages
12
Water mesh was above ground mesh. Result is all overlays (targeting and shadow) float above the ground. Just because water flag is disabled does not mean the mesh is not there.

I re-computed the water mesh for the entire map to be -0.25 normalized units below the ground mesh. I cannot guarantee that the problem is completely fixed (or that parts of the map are not broken as a result) everywhere but some rough tests could not re-create the problem anymore.

This is what the water mesh looked like before applying height clamp.
attachment.php

This is the one I generated.
attachment.php

This JAVA code was used in combination with my W3E API to produce the new water mesh.
Code:
		System.out.println("performing transfrom");
		terrain.simpleTransform(V -> {
			double egh = TerrainVertex.convertHeightVertexToNormalized(V.getGroundHeight()) + V.getCliffLevel() - 2;
			double ewh = TerrainVertex.convertHeightVertexToNormalized(V.getWaterHeight()) - 0.7;
			if( ewh > egh ) V.setWaterHeight(TerrainVertex.convertHeightNormalizedToVertex(egh + 0.7 - 0.25));
		});

Darker means lower and you can see that a lot has been lowered.
Thanks,you are good,can I know how did you do this 0.0. I want to learn it XD
 
Status
Not open for further replies.
Top