• Dear visitors,

    The email issue has been finally solved.
    Thank you for your patience and happy browsing.

    Team ACM.

TUTORIAL 3D grass

luchian

Administrator
Staff member
AC member SandroX made a video back in July, on how to make 3d grass with 3ds max. Maybe you guys find it usefull as well:


Objects with suffix KSLAYER5 will be visible only at settings World Detail Maximum, KSLAYER4 on Very High, KSLAYER3 on High and so on. Some examples:

grassA_KSLAYER1, grassB_KSLAYER1, plantA_KSLAYER1, bushA_KSLAYER1, etc - will all be groupped and visible starting from lowest world detail.

grassX_KSLAYER2, grassY_KSLAYER2, grassZ_KSLAYER2, etc. - will all be visible starting from world detail 2


For shader settings, of course you can define your own, but in case you need a starting point, here's an example (also thanks to SandroX) :

nw_gs.jpg
 

luchian

Administrator
Staff member
In case you are using Blender, AC member skombijohn (<thank you) shows the way :D

1) Create the object (a cube for example)
2) Apply 2 array modifiers, set each to the desired number of iterations (they get multiplied!)
3) Set the relative offset of one modifier to somthing bigger than 1 on X axis and on the other on Y axis (see screen)

3d_grass_01.png


4) Apply both modifiers.
5) Now you have a single object with many cubes. Let's split em!
6) Select the object, go to Edit Mode, select all vertices.
7) Hit "P" and choose "by loose objects".
8) Leave Edit mode, and you have independet objects!
9) Now we must correctly set all the objects orgins. So select all single cubes and choose "Set Origin -> Origin to Geometry".

3d_grass_02.png

Result:

3d_grass_03.png

10) Let's randomize them: With all cubes selected we use the "Randomize Transform" function. To find that function quick hit SPACE and simply type "Randomize Transform".

3d_grass_04.png

11) in the tool panel there are now settings for the random transform:

3d_grass_05.png

12) When you are happy hit CTRL-A and select "Rotation and Scale" to apply the transformation
13) Now with all cubes selected simply join them.

3d_grass_06.png

14) done.
 

Fat-Alfie

New Member
Quick question: with world detail set to maximum, do you see objects named kslayer5, kslayer4, kslayer3 etc? Or only those named kslayer5? I.e. do they build up together or is each 'layer' viewed in isolation?
 

Fat-Alfie

New Member
I just did a quick test and yes, I can confirm that KSLAYER3 objects appear when world detail is set to 'high', 'very high' and 'maximum' - so they build up.

[Sorry, I could have just tested that in the first place instead of asking on the forum :rolleyes:]

I was going to set my grass objects within each area at 500 for KS3, 1000 for KS4 and 2000 for KS5, but now I have done that test, that would mean on KS5 I would have 2000+1000+500 objects visible (3500) and not the 2000 I thought. I guess I could set KS3 to 600, and then just duplicate each object for KS4 and then KS5, giving me a total count of 1800 objects on KS5.

I think I need to test performance before I go much further o_O

Thanks for your help, btw :)
 

Johnr777

Moderator
GRASS_FX! (CSP 245 and above)

Here's a quick explanation on how to apply procedural grass to your track:

1) Make sure this system is enabled, check CM settings and the Grass_fx.ini file in the extension folder.
I would disable... CAST_SHADOWS=0, GROUND_COVERING_GRASS=0, EXTRA_DENSE=0

Shadows can be a bit weird, ground covering grass helps with blending, but looks horrible at the moment, and hides your grass detail maps, you might not want that... and extra dense, only if you really have the hardware for it!

You'll be able to see it in action in a few tracks: Brands Hatch, Spa, Highlands, Nurburgring...

2) If your track has a configuration ini file already, great, if not, will need to create one!

The best method to do this now is to create a new folder inside your track/project, and name that folder extension . Inside that folder, create a text file and name it ext_config.ini . This is a good way to create configurations files since its prioritized over any other folder, and from a few patch versions ago, you can edit it in realtime as well.

3) Inside that configuration ini, you need to add the following:
[GRASS_FX]
GRASS_MATERIALS = the name of the material(s) you want procedural grass on top of

OR

GRASS_MESHES = the name of the mesh(s) you want procedural grass on top of

You may also need to insert the following tags, to trim, tweak, etc.

OCCLUDING_MESHES = any mesh name entered here will serve as a boundary "zone" to not have grass on.. (ie, kerbs, if they overlap a grass area)

OCCLUDING_MATERIALS = same as above, but with a material instead

OCCLUDING_MATERIALS_ALPHA = if an overlaying mesh has an alpha channel, say a gravel edge for example, you can enter the material name of that edge, and this tag will use the white part of the alpha for boundaries!

ORIGINAL_GRASS_MATERIALS= enter here name of the existing 3D grass material if it exists, it will hide it automatically when grass_fx is enabled

AND

This system relies on grass color to generate procedural grass objects, it mostly sees green, but... there are cases when the track or project doesnt really feature a green grass surface for whatever reason... Kyalami, Sebring, a patchy dead/dry area for example...

COLOR_FACTOR = numbers higher than 1 will allow grass to spawn on not so green surfaces, im assuming less than 1 will require more green?

TWEAKS

HEIGHT_MULT = this is the grass height parameters, i think default is 0.5?

_________________________________

There are more tags that can be used, and ways to clean things up/optimize... I'll show examples later on, but this should help get you a preview of grass_fx! There are also a few examples in inis for other tracks that can be used for reference: https://github.com/ac-custom-shaders-patch/acc-extension-config/tree/master/config/tracks

Its an early system with lots of bugs... Ilja even mentioned he might replace certain things, but its safe to say its the future of AC "vegetation" modding.

Kyalami - Conventional grass scattering method:

Screenshot_ier_porsche_911_gta_kyalami_2016_29-10-119-1-19-25.png


Procedural grass:

[GRASS_FX]
GRASS_MATERIALS = Base_Grass_Edge, Base_Grass_Tile, Embank_Tile, Embank_Grassy_Tile
OCCLUDING_MESHES = edge??, Cars??, Canopy??
OCCLUDING_MATERIALS_ALPHA = Gravel_Edge
HEIGHT_MULT = 0.3
COLOR_FACTOR = 1.06

Screenshot_ier_porsche_911_gta_kyalami_2016_29-10-119-1-10-3.png




Hope this helps.
 

MGMetroDave

Active Member
@Johnr777 Thank you, this is an excellent explanation. I totally agree with your words on disabling ground covering grass, extra dense and shadows.

I have a few questions, which to be honest I'm not expecting anyone to know the answer to yet, but I'll try anyway. :lol:

Does anyone happen to know...
1. How to use my own textures for the grass? Ilja mentioned that the current texture is the 'default' texture, which suggests there's a way of overriding it? The default textures are found in assettocorsa\extension\textures\grass_fx, and you can take a guess about how they work. They have 8 sprites/textures from top to bottom for the 'common.dds' (upright grass) and 4 sprites top to bottom for the ground cover. They have a green channel being used for the parts of the grass that will inherit their colour from the ground beneath, the blue and red channels seem to be used for adding other colours for a bit of variety, such as flowers, and then an alpha for transparency. So it seems fairly simple to make your own textures, but I don't know where to put them or how to activate them.

2. Is there a way to disable shadows, ground-covering grass and extra dense on a per-track basis via the track ini file? My track really looks best without those, as well as running quicker, and I'd like to disable them for my track.

3. I've noticed that with GrassFX disabled there's a difference to the normal ksGrass on my track in the latest CSP preview 245 compared to the previous preview 205 build. I can't quite work out what's happened. I think it's lowered the grass shaders on the Z-axis by a little bit, or perhaps disabled some of it? I'm not entirely sure what's happened. In fact I thought it was my imagination but I've since switched back and forth between 245 and 205 and the ksGrass in 205 looks perfect but very strange in the latest CSP build.

Sorry I know I'm forever asking annoying questions! :lol:
 

Johnr777

Moderator
@Johnr777 Thank you, this is an excellent explanation. I totally agree with your words on disabling ground covering grass, extra dense and shadows.

I have a few questions, which to be honest I'm not expecting anyone to know the answer to yet, but I'll try anyway. :lol:

Does anyone happen to know...
1. How to use my own textures for the grass? Ilja mentioned that the current texture is the 'default' texture, which suggests there's a way of overriding it? The default textures are found in assettocorsa\extension\textures\grass_fx, and you can take a guess about how they work. They have 8 sprites/textures from top to bottom for the 'common.dds' (upright grass) and 4 sprites top to bottom for the ground cover. They have a green channel being used for the parts of the grass that will inherit their colour from the ground beneath, the blue and red channels seem to be used for adding other colours for a bit of variety, such as flowers, and then an alpha for transparency. So it seems fairly simple to make your own textures, but I don't know where to put them or how to activate them.

2. Is there a way to disable shadows, ground-covering grass and extra dense on a per-track basis via the track ini file? My track really looks best without those, as well as running quicker, and I'd like to disable them for my track.

3. I've noticed that with GrassFX disabled there's a difference to the normal ksGrass on my track in the latest CSP preview 245 compared to the previous preview 205 build. I can't quite work out what's happened. I think it's lowered the grass shaders on the Z-axis by a little bit, or perhaps disabled some of it? I'm not entirely sure what's happened. In fact I thought it was my imagination but I've since switched back and forth between 245 and 205 and the ksGrass in 205 looks perfect but very strange in the latest CSP build.

Sorry I know I'm forever asking annoying questions! :lol:
1. We are working on getting the ability to have different textures per track, as needed (We asked Ilja nicely, :lol:). But in the meantime, you can overwrite that common.dds file with your own work :)

2. Unfortunately, not that I know of yet..

3. Ilja changed how alpha channels work... Theres no more alpha blending/ smoothing bands for certain shaders. They are sharp. Something called alpha-to-coverage, which im not a big fan of, he has mentioned he could add an enable/disable option to this, so theres hope!
 

MGMetroDave

Active Member

MGMetroDave

Active Member
Alternative grassfx texture, for those who don't mind experimenting. It works well for long grass especially. Contains a few weeds. Feel free to test now and feel free to use in your own tracks when custom grassfx textures become possible...

(unzip, goes in assettocorsa\extension\textures\grass_fx and don't forget to back up your old common.dds!)
 

Attachments

luchian

Administrator
Staff member
GRASS_FX! (CSP 245 and above)

Here's a quick explanation on how to apply procedural grass to your track:

1) Make sure this system is enabled, check CM settings and the Grass_fx.ini file in the extension folder.
I would disable... CAST_SHADOWS=0, GROUND_COVERING_GRASS=0, EXTRA_DENSE=0

Shadows can be a bit weird, ground covering grass helps with blending, but looks horrible at the moment, and hides your grass detail maps, you might not want that... and extra dense, only if you really have the hardware for it!

You'll be able to see it in action in a few tracks: Brands Hatch, Spa, Highlands, Nurburgring...

2) If your track has a configuration ini file already, great, if not, will need to create one!

The best method to do this now is to create a new folder inside your track/project, and name that folder extension . Inside that folder, create a text file and name it ext_config.ini . This is a good way to create configurations files since its prioritized over any other folder, and from a few patch versions ago, you can edit it in realtime as well.

3) Inside that configuration ini, you need to add the following:
[GRASS_FX]
GRASS_MATERIALS = the name of the material(s) you want procedural grass on top of

OR

GRASS_MESHES = the name of the mesh(s) you want procedural grass on top of

You may also need to insert the following tags, to trim, tweak, etc.

OCCLUDING_MESHES = any mesh name entered here will serve as a boundary "zone" to not have grass on.. (ie, kerbs, if they overlap a grass area)

OCCLUDING_MATERIALS = same as above, but with a material instead

OCCLUDING_MATERIALS_ALPHA = if an overlaying mesh has an alpha channel, say a gravel edge for example, you can enter the material name of that edge, and this tag will use the white part of the alpha for boundaries!

ORIGINAL_GRASS_MATERIALS= enter here name of the existing 3D grass material if it exists, it will hide it automatically when grass_fx is enabled

AND

This system relies on grass color to generate procedural grass objects, it mostly sees green, but... there are cases when the track or project doesnt really feature a green grass surface for whatever reason... Kyalami, Sebring, a patchy dead/dry area for example...

COLOR_FACTOR = numbers higher than 1 will allow grass to spawn on not so green surfaces, im assuming less than 1 will require more green?

TWEAKS

HEIGHT_MULT = this is the grass height parameters, i think default is 0.5?

_________________________________

There are more tags that can be used, and ways to clean things up/optimize... I'll show examples later on, but this should help get you a preview of grass_fx! There are also a few examples in inis for other tracks that can be used for reference: https://github.com/ac-custom-shaders-patch/acc-extension-config/tree/master/config/tracks

Its an early system with lots of bugs... Ilja even mentioned he might replace certain things, but its safe to say its the future of AC "vegetation" modding.

Kyalami - Conventional grass scattering method:

View attachment 3970

Procedural grass:

[GRASS_FX]
GRASS_MATERIALS = Base_Grass_Edge, Base_Grass_Tile, Embank_Tile, Embank_Grassy_Tile
OCCLUDING_MESHES = edge??, Cars??, Canopy??
OCCLUDING_MATERIALS_ALPHA = Gravel_Edge
HEIGHT_MULT = 0.3
COLOR_FACTOR = 1.06

View attachment 3971



Hope this helps.
@Johnr777 do you happen to know why there are 2 modules named Grass_Fx in CSP/Content Manager ?
 
Top