Custom Objects Shadow Problem

Talk about avatars, crosshairs, mods, skins and share them !

Moderator: English Moderator

jui
Posts: 171
Joined: 16 May 2013, 15:58

Re: Custom Objects Shadow Problem

Post by jui »

xrayjay wrote:Guess you can´t fix this, some textures are "fixed" to an axis (f.e. all the ...pxz ones works only on one axis and if you turn the object the texture will look deformed/ugly), guess the TechWall is fixed to the x axis, may you have to look for an alternative texture. Or try to unwrap your parts to that texture, may this solves this here.
(or there´s an work around for that and i didn´t know it^^ this appears on all titles with some textures also)
Maybe not the right thread but i think it would be really nice if Nadeo could shed some light on this "texture projection" topic. Why are there materials that only work on vertical or horizontal faces but some materials work on both, why not make all materials work on both, maybe performance?
Is it possible to fix with some settings in Blender or through UV mapping?
A bit short information would help a lot and also would be interesting. :)

@maxi nice tip thx.
Fix
Nadeo
Nadeo
Posts: 1256
Joined: 14 Jun 2010, 17:28

Re: Custom Objects Shadow Problem

Post by Fix »

Why not make materials work on all directions?
It is indeed for performance, and technical limitations, making it work implies that the shader would be a lot more complex (this is Luckyboy's part here, i won't enter in details because I maight say wrong things), maybe the geometry would have to be drawn many times.
But the art team also dream of this magic material.
We have one almost working in every directions, for storm/canyon cave roofs, but because of how the lightmap system works, we still have to switch to the vertical one as soon as possible.

The "UV in World" materials are used for big surfaces, often used for natural surfaces such as dirt, grass or cliff, it allows to have continuity of pixels on the geometry, whatever you do, and to blend controlled (UV1) textures on top of these (transition from road to dirt for exemple).

For Trackmania Original and Sunrise, only the ground material was using UV coordinates in world.
Cliffs were using UV1, and we had to do tricks such as Mirroring UVs to avoid stretching or ugly UV seams. If you look at the Snow mountains, you'll see a lot of rorschach monsters ^_^.
We still have these mirror monster faces on the little transitions between materials, because as they use UV coordinates, we need to use the same trick.

Another bonus of world coordinates is you can have the texture repeat itself at another frequency than the block grid, so the same block placed at 2 different places won't look the same.
We applied this system to big surfaces of concrete for the Canyon's Dam, or big surfaces of Metal/Bricks to storm.
If we use the standard UV1 method for these, we have to deal with the tiling of the texture on the borders of the blocks, and this is really visible and counter natural visual effects such as stains, that span across multiple blocks.

Also, it makes the creation of some blocks faster, because making good UV1 is time consuming (no strecthing, no seams).

This allowed us to have perfect tree trunk cylindrical texturing in storm, (excepted on horizontal branches).

If a block is part of a collection used to build big surfaces (castle walls, arena floors, etc..), it's better to use World Coordinates materials.
If a block is part of a collection of modular technical elements (roads, bridges, beams, etc..) it's better to use UV coordinates.

In the previous example, platform would have been the right choice, or MetalCover.
User avatar
xrayjay
Posts: 1481
Joined: 29 Aug 2010, 14:19

Re: Custom Objects Shadow Problem

Post by xrayjay »

maxi031 wrote:Hope i am not far from topic.
I did some editing on lib file and discovered that you can construct your own material inside of lib as long as it follows special lib syntax and is using game textures.

Lets say textures for your material are PlatformD.dds, PlatformS.dds and PlatformN.dds, you can than add material to lib like this:

Code: Select all

DMaterial(AddedPlatformMaterial)
		DSurfaceId	(ResonantMetal)
		DUvLayer	(BaseMaterial	, 0)
		DUvLayer	(Lightmap		, 1)
		DTexture( PlatformD.dds)
		DTexture( PlatformS.dds)
		DTexture( PlatformN.dds)
Paste this in Storm lib and it should work as valid game material. :D
Great idea, will test this asap :thumbsup: :thx:
jui
Posts: 171
Joined: 16 May 2013, 15:58

Re: Custom Objects Shadow Problem

Post by jui »

Thanks Fix for information. :yes:
Its good to know that there are indeed materials that do not work (look ugly) on certain geometry but others work on almost every geometry (the "UV in world coordinates" ones if i understood correctly).

A complex topic so we have to do a bit try and error when making things i guess ;)
User avatar
Nerpson
Translator
Translator
Posts: 1554
Joined: 27 Sep 2013, 18:02
Location: France
Contact:

Re: Custom Objects Shadow Problem

Post by Nerpson »

I had a problem with shadows too, with my giant moutain item.
→ http://puu.sh/dKxe4/ab727a7d5f.png
Shadows are particularly dark. (when shadows are computed in Ultra)

I had another problem too (off-topic):
→ viewtopic.php?f=321&t=13673&start=920#p236621
ImageImageImageImage
User avatar
xrayjay
Posts: 1481
Joined: 29 Aug 2010, 14:19

Re: Custom Objects Shadow Problem

Post by xrayjay »

@Nerpson
You´ve just got tooooo much verts/faces etc., 262 144 verts are way to much imo :D (and this is only the "low" variant^^)
And it´s kind of displaced, means the 0 point is somewhere outside your object. May you should try to reduce the overall count of verts/faces and place this whole thing correct, reset the location/rotation/scale to 0, set the shading to smooth and make your object way smaller (now its 1700x1700x271 in blender size count). This all will reduce the overall filesize, you can set the size later inside the MeshParams way easier than make your object 1:1.
Imo you can realize these kind of mountains with less verts/faces and it will also looks nice and smooth, it´s just to much "HD" now :)
In general it´s imo the best to keep the verts/face count as low as possible
User avatar
HubbleSM
Posts: 166
Joined: 18 Mar 2013, 19:38
Location: Germany
Contact:

Re: Custom Objects Shadow Problem

Post by HubbleSM »

maxi031 wrote:

Code: Select all

DMaterial(AddedPlatformMaterial)
		DSurfaceId	(ResonantMetal)
		DUvLayer	(BaseMaterial	, 0)
		DUvLayer	(Lightmap		, 1)
		DTexture( PlatformD.dds)
		DTexture( PlatformS.dds)
		DTexture( PlatformN.dds)
Paste this in Storm lib and it should work as valid game material. :D
Thanks for this hint, i'll try to do my own library with this (makes it very easy to combine different Textures with SurfaceIds) :yes:
Although it's not working for me :?
I created the new Material "TechWallStone" and the only thing i changed was the Surface Id

Code: Select all

DMaterial(TechWall)
		DSurfaceId	(TechWall)
		DUvLayer	(Lightmap		, 0)
		DTexture( TechWall_D.dds)
		DTexture( PlatformPxz_S.dds)
		DTexture( PlatformPxz_N.dds)
		
DMaterial(TechWallStone)
		DSurfaceId	(Stone)
		DUvLayer	(Lightmap		, 0)
		DTexture( TechWall_D.dds)
		DTexture( PlatformPxz_S.dds)
		DTexture( PlatformPxz_N.dds)
The result ingame is that i get only a grey texture. :roflol:
I also tried to add a line with a BaseMaterial, but i got the same result and 1 time the Importer crashed...
Image

Admin: ManiaCalendar
Member: http://www.smurfen.net/

OS: Windows 10 Home 64-bit
CPU: Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz (8 CPUs), ~2.6GHz
RAM: 16GB DDR3
GPU: NVIDIA GeForce GTX 950M
Post Reply

Return to “Workbench”

Who is online

Users browsing this forum: No registered users and 0 guests