• Welcome to MX Bikes Official Forum. Please login or sign up.
 
March 29, 2024, 12:28:59 AM

News:

MX Bikes beta18j available! :)


Trying to create a night track with spot lights.

Started by Ruubs, November 12, 2018, 05:18:23 PM

Previous topic - Next topic

Ruubs

I'm currently working on a night track with spot lights. The whole track should be dark, except for the areas around the lights. Does anyone have an idea on how to get this effect?

My idea was to create a new texture layer which would be a plain black texture which'll then be the top layer. That'll make the dark spots dark, and I can mask out the areas around the lights. The thing is though, with deformation, that layer will be ridden off. Once a couple of laps are ridden, the whole track would look lit and wouldn't look the way it's supposed to look. Obviously the shadow of the rider won't be right either way. We really need to be able to place more lighting sources so we can make proper night tracks.

This is the idea (image from Mx vs Atv twitter):


Tell me your ideas, be creative.

𝖙𝖋𝖈

I've put a lot of thought into this over the years. You only currently have a few options.

Black fog. You can make it black and dense but that relies on the track being quite small.

Black layer. You can change the thickness so the texture doesn't erode and you can leave the physical thickness low so it deforms  properly. How you get the layers underneath to deform though is beyond me sorry.

You can use that prefix to stop an object from being shaded which is probably useful for light sources.

Not a lot else you can do.

PizzaChet

This would be awesome and it's important for tracks like Supercross and TNMX where 75% of the racing is under the lights. It looks really good in the MvA shot!  :-[
Quote from: YodaIf no mistake have you made, yet losing you are ... a different game you should play.

Ruubs

Thanks TFC. A few things to try out there.

Lets all get @PiBoSo attention and ask him to add a 'non deformation' parameter for the HMF.
Idea would be that there's one additional parameter in a texture slot, like the mask parameter:
mask = masks/grassmask.tga;
deform = 0;

That way deformation would just 'skip' that layer.

Such a texture can actually be used for more than just a night track.

Does @forumname actually do anything? :-X

iNsane



   🌐 MX Bikes custom content
MXB-Mods.com

   📚 MX Bikes User Wiki
MXB-Wiki.com

   💸 Feel free to donate
PayPal

𝖙𝖋𝖈

Quote from: Sandbiter on November 12, 2018, 06:32:43 PM
Thanks TFC. A few things to try out there.

Lets all get @PiBoSo attention and ask him to add a 'non deformation' parameter for the HMF.
Idea would be that there's one additional parameter in a texture slot, like the mask parameter:
mask = masks/grassmask.tga;
deform = 0;

That way deformation would just 'skip' that layer.

Such a texture can actually be used for more than just a night track.

Does @forumname actually do anything? :-X

Sounds good to me.

Asdrael

Have you tried putting a solid box around your map and the main light source outside of it? To see if the track is then black or not.

I know you can only have one light source, but maybe by creating a box around the track with holes in it to let the light go through you'd achieve the same effect.
Donate to me -> feed my coffee addiction -> get more mods!
OEM bikes pack
MXBikes Discord

𝖙𝖋𝖈

Quote from: Asdrael on November 13, 2018, 12:55:16 PM
Have you tried putting a solid box around your map and the main light source outside of it? To see if the track is then black or not.

I know you can only have one light source, but maybe by creating a box around the track with holes in it to let the light go through you'd achieve the same effect.

That's thinking outside the box  ;D

That mixed with black fog could work well..

Ruubs

Quote from: тғc on November 13, 2018, 01:30:45 PM
Quote from: Asdrael on November 13, 2018, 12:55:16 PM
Have you tried putting a solid box around your map and the main light source outside of it? To see if the track is then black or not.

I know you can only have one light source, but maybe by creating a box around the track with holes in it to let the light go through you'd achieve the same effect.

That's thinking outside the box  ;D

That mixed with black fog could work well..

I gotta try that. Great idea Asdrael.

Am I correct that the lightsource always points at the middle of the track? I know you can set the light source position, but where does it point towards?

𝖙𝖋𝖈

It has to be middle. I'd go for directly above if trying this

Ruubs

Quote from: тғc on November 13, 2018, 03:10:45 PM
It has to be middle. I'd go for directly above if trying this
That's what I thought. Thanks for clarifying!

Asdrael

Since you define the light source position, it might be a point source. It that case it doesn't point toward anything, just toward... everything. Easy way to try: 3 poles on the middle of the track, light source at the edge of the heightmap at ground level, see if the pole shadows are parallel.

Also, don't forget that you need to define the light source for the "rider" (the amb in the track folder) and for track creation (during the THT compilation step iirc).
Donate to me -> feed my coffee addiction -> get more mods!
OEM bikes pack
MXBikes Discord

𝖙𝖋𝖈

Quote from: Asdrael on November 13, 2018, 03:55:28 PM
Since you define the light source position, it might be a point source. It that case it doesn't point toward anything, just toward... everything. Easy way to try: 3 poles on the middle of the track, light source at the edge of the heightmap at ground level, see if the pole shadows are parallel.

Also, don't forget that you need to define the light source for the "rider" (the amb in the track folder) and for track creation (during the THT compilation step iirc).

You're right. There's no perspective. 3 poles with the light source above will probably give no shadows. Is orthographic the right word?

PizzaChet

Definition of orthographic
1 : of, relating to, being, or prepared by orthographic projection
an orthographic map
2a : of or relating to orthography
b : correct in spelling


or·thog·o·nal
/ôrˈTHäɡənl/Submit
adjective
adjective: orthogonal
1.
of or involving right angles; at right angles.
2.
STATISTICS
(of variates) statistically independent.
(of an experiment) having variates that can be treated as statistically independent.
Quote from: YodaIf no mistake have you made, yet losing you are ... a different game you should play.

𝖙𝖋𝖈

Quote from: PizzaChet on November 14, 2018, 06:29:31 PM
Definition of orthographic
1 : of, relating to, being, or prepared by orthographic projection
an orthographic map
2a : of or relating to orthography
b : correct in spelling


or·thog·o·nal
/ôrˈTHäɡənl/Submit
adjective
adjective: orthogonal
1.
of or involving right angles; at right angles.
2.
STATISTICS
(of variates) statistically independent.
(of an experiment) having variates that can be treated as statistically independent.


Yes so like..