• Welcome to Kart Racing Pro Official Forum. Please login or sign up.
 
September 28, 2021, 10:30:22 PM

News:

Please read the FORUM RULES


Track shadows (and skidmarks) missing sometimes

Started by pl4sma2389, September 06, 2021, 08:00:39 AM

Previous topic - Next topic

pl4sma2389

Hello all,
I've been slowly learning how to make tracks for KRP, and the first track I made I noticed that there were no shadows being laid down by any objects, such as the kart, buildings, poles, etc. Objects self-shadow but no shadows appear on the ground.
You cannot see attachments on this board.
The kart would become dark if it drove under a place where a shadow should be but there was no shadow on the ground.
However, the next track I made, and all subsequent tracks I've made, the shadows do show up and work as expected.
You cannot see attachments on this board.
I have been further developing this first track, and even with the same options selected in FBX2EDF as the tracks with working shadows, no shadows have ever showed up.
The skidmarks that appear whenever you slide the kart around also do not show up if the shadows don't show up, where they do show up on my other tracks where the shadows work as well.
I do not know what could be causing this. Anyone have any ideas?

LXS77

Hello pl4sma2389,

Whether an object would cast a shadow on a surface depends on the surface's name, so please check the names of surfaces in your first project.

"By default only TRK and WLL objects will receive shadows. To force an object as shadows receiver use the SHAD_ prefix (useful for parts of the track which are visible but not drivable)." (http://docs.piboso.com/wiki/index.php?title=Track_Creation_Guide)

Skidmarks should only appear on drivable surfaces (e.g. trkasph, pit_trkcasph).

pl4sma2389

I've double checked, and the objects are named correctly (TRKASPH, PIT_TRKASPH, TRKGRAS, TRKGRAS2). I'll try putting SHAD_ in front of them, but if they're already not showing shadows I don't see how that's going to help.

LXS77

Hmm, OK...

I did some testing and could only replicate the missing shadow if there was no texture assigned to the surface (image attached).

And how do you apply textures? On the G&J screenshot it seems like one huge photo is attached to the mesh. On NJMP, however, it looks more like tiled tarmac and carefully reproduced line paintings...

pl4sma2389

Quote from: LXS77 on September 07, 2021, 11:10:08 PMHmm, OK...

I did some testing and could only replicate the missing shadow if there was no texture assigned to the surface (image attached).

And how do you apply textures? On the G&J screenshot it seems like one huge photo is attached to the mesh. On NJMP, however, it looks more like tiled tarmac and carefully reproduced line paintings...


For G&J, the track mesh and grass mesh immediately surrounding the track are textured from an orthophoto generated by photogrammetry from a drone. For NJMP, the textures for all the non-track areas are from a Google satellite photo from BlenderGIS. I also used a Google satellite photo from BlenderGIS for the surroundings of G&J.
You cannot see attachments on this board.
The tiled tarmac texture is only for the track, shadows do appear on the large satellite photo material for NJMP. They don't appear on the satellite photo or the drone orthophoto for G&J.

LXS77

September 09, 2021, 01:48:05 AM #5 Last Edit: September 09, 2021, 01:52:34 AM by LXS77
Wow, I guess, you are the first person who has used photogrammetry to create a track for KRP. Congratulations!!!  :)

And how does the track feel? Is it close to the reality, like all the bumps are in right places, etc.?

I've played a bit with Blender this evening. Can you please check if your Mesh Data blocks have exactly the same names as the objects they belong to? (see the attached images)

pl4sma2389

Quote from: LXS77 on September 09, 2021, 01:48:05 AMWow, I guess, you are the first person who has used photogrammetry to create a track for KRP. Congratulations!!!  :)

And how does the track feel? Is it close to the reality, like all the bumps are in right places, etc.?

I've played a bit with Blender this evening. Can you please check if your Mesh Data blocks have exactly the same names as the objects they belong to? (see the attached images)

You can check out the track at its public release page here: https://www.racedepartment.com/downloads/g-j-kartway.43993/
Having raced in the track's local club events for nearly five years, I can say that the surface is very realistic. It might be much more bumpy than you are used to for a KRP track, but it is accurate.

My Mesh Data blocks were not named the same. I'll try renaming them and we'll see if that fixes the problem.

pl4sma2389

OK, I tried renaming the mesh data to the same as the object and reexporting it, and I can confirm that this did not fix the shadows or the skidmark issue.

LXS77

September 11, 2021, 12:17:27 AM #8 Last Edit: September 11, 2021, 12:46:17 AM by LXS77
I see... Well, it should be something about the texturing then :)

In my tests, when a JPG texture is attached as a material, both shadows and skidmarks work just fine. Can you upload a screenshot with, let's say, PIT_TRKASPH object expanded? How exactly do you texturise it?

Steven

Do the ground textures have an alpha channel? If a texture has transparency it also won't receive shadows and skidmarks.

LXS77

September 11, 2021, 06:11:43 PM #10 Last Edit: September 11, 2021, 06:24:52 PM by LXS77
Quote from: Steven on September 11, 2021, 09:47:17 AMIf a texture has transparency it also won't receive shadows and skidmarks.
Mmm, not quite. Depends on the level of transparency :) There will be no shadows, but skidmarks, stalls and corridors may still be visible. Please see the attached image - a drivable surface is textured with a .DDS (DXT5), the green area is semi-transparent.

pl4sma2389

Quote from: LXS77 on September 11, 2021, 12:17:27 AMI see... Well, it should be something about the texturing then :)

In my tests, when a JPG texture is attached as a material, both shadows and skidmarks work just fine. Can you upload a screenshot with, let's say, PIT_TRKASPH object expanded? How exactly do you texturise it?


The texture for the track surface and the immediate surroundings is a large .tga file straight from the photomapping software, but resized to fit to 8192x16384 pixels. I've found that if you try to use an image that is 32768x32768, FBX2EDF crashes. The photo does have transparency.
You cannot see attachments on this board.

The texture for the surrounding areas of the track is from BlenderGIS's Google Earth import, but resized to fit 16384x8192 pixels. That photo also has transparency.
You cannot see attachments on this board.

I'll try using versions of the photos without the transparency. I think that .tga textures with transparency don't receive skidmarks or shadows, as I've used .tga textures for other tracks with no issue.

pl4sma2389

September 16, 2021, 03:19:08 AM #12 Last Edit: September 16, 2021, 03:28:41 PM by pl4sma2389
Everything seems to be working now. Thanks for the help!
You cannot see attachments on this board.

LXS77

Quote from: pl4sma2389 on September 16, 2021, 03:19:08 AMEverything seems to be working now. Thanks for the help!

You're welcome! Glad it's all working fine now! So Steven was right, transparency was the issue...

I did several laps on the track and it was real fun! A proper workout for arms and wrists! :) Well done, mate!

LXS77

Quote from: pl4sma2389 on September 15, 2021, 11:47:15 PMI've found that if you try to use an image that is 32768x32768, FBX2EDF crashes.

Yeah, the thing is, in KRP track creation, large satellite images are usually used as guides to layout the mesh, which is then textured with tileable images. Normally, 4K images are more than enough for such purposes. So, I'd say, you are not only the first person to use photogrammetry in KRP, but also the first who has tried and used such a large image as a texture for the mesh :-)) It is, for sure, an interesting approach, but not without some disadvantages (for example, you won't be able to use shaders and 3D grass).

BTW, would you like to consider using DDS or JPG format for that image? This would make the .MAP file size way smaller.