• Welcome to Kart Racing Pro Official Forum. Please login or sign up.
 
March 04, 2021, 08:25:09 AM

News:

Kart Racing Pro release12 available! :)


Is it possible to do 3D grass and wet reflections from 3DS Max 2013 x64?

Started by rainey06au, July 31, 2020, 12:28:08 PM

Previous topic - Next topic

rainey06au

For the past week I've been struggling with the process to render 3D grass blades (.grs file) and wet track reflections (alpha map on second UVW Map channel).  My workflow is to have built my mesh and assigned standard materials in 3DS Max 2013, exported to FBX and then using the 'fbxtoedf' tool I convert my 3D objects (track mesh, terrain, and buildings), and the compile using Terrained etc.  I am now wondering if these two particular issues are even possible to support without having a 3DS Max 2013 x64 compatible plugin for exporting?  Ingame I don't have any 3D grass, and my track surface just gets darker with the wetness slider but I don't see my puddles. Can someone please tell me if I'm doing something wrong of if I'm wasting my time without a 2013 plugin.

LXS77

Hi, not sure about puddles, but for a 3D grass a 2013 plugin is definitely not needed. The FBX2EDF tool will do it for you. The trick is that the .GRS should have exactly the same name as your main grass texture file. For example, if your 2D grass texture is named grass_main.dds, the .GRS to generate 3D blades on this surface should be called grass_main.grs. Then a very good start for a 3D grass blade texture would be PiBoSo's original grassfx.tga from his example track files (you can find the link on this page - http://docs.piboso.com/wiki/index.php?title=MXB_Track_Creation_Guide). Once your .FBX is ready, simply put a .GRS file and grassfx.tga into the same directory where all your track's textures are and run FBX2EDF to create a .MAP file. If all goes well, you should be able to see 3D grass when viewing the track in MapView.

rainey06au

I just can't get it to work. As far as I can tell I have everything required in place.  In the attached screenshot you can see I don't have a line in the .grs file to call for the mask map (just trying to get the compiler to draw the 3d blades in ANY form to begin with!) but it should be drawing the grass blades across the entire texture and DOESN'T! Cannot figure this one out!

rainey06au

Pretty keen to finish off the look of my environment and it's driving me bonkers. You can see I've got working bump, and specular maps etc. With the wet surface I've tried a variety of dropping the RGB to white and just having an alpha etc.










LXS77

Hi, the track looks great indeed! Well done!

I'm just looking at the file size of grassfx.tga. On your screenshot it's only 240KB. The PiBoSo's file weighs 1MB (1024x256px). Try to use his file without any amendments to it. And what's the resolution of your GND_grass006e6 texture?

rainey06au

Hmm good observation!  I had used the original grassfx.tga but made some colour adjustments. I think maybe I've lost something when I did that. I have just put the original grassfx.tga from the example map back instead. Currently compiling so I'll let you know how it goes in 10 mins!  The resolution of my grass006e6 is 2048x2048 and same with the mask '_g' version.

rainey06au

Still no 3D grass. There's nothing special about the infield meshes in 3DS Max or the texture map (pic attached)

LXS77

Yeah, it looks fine...

Well, that's how it works in my case (image attached). If you don't mind sharing the FBX file, just PM me, will try to see what goes wrong there...

rainey06au

Hmmm yes your effect is really good. The track surface and the grass terrain are all combined into a single .EDF model in my track. Do you know if this could be a problem? Do all of the TRKGRAS_ surfaces need to exist exclusively in their own .EDF?

LXS77

Thanks! :)

But why would you use EDF for that? According to http://docs.piboso.com/wiki/index.php?title=FBX2EDF, Mesh (.edf) should be used for things like skydomes and helmets. For track geometry and track objects, there are MAP (.map) and Collision (.trp).

rainey06au

Dude!!!  That's probably it!!  I didn't really know what the other options were and hadn't been reading the FBX2EDF guide! Funnily enough the track has been driving well on an EDF file..

LXS77

Yep, guides can sometimes be useful :) Just try to create a .MAP file and open it with MapView, let's see if this makes any difference.

rainey06au

Thank you mate! You're a genius. That's exactly where I was going wrong.  3D grass will not draw from a standard .EDF model.  That's made my day! :)

LXS77

:D  You're most welcome! And don't forget about the collision file (.trp), you'll need it to finalise the track in TrackED (central line, dynamic surface, grid, pits, etc.)

rainey06au

I exported the same FBX file as a .trp for the collision as well assuming that is the correct thing to do.  Now I'm stuck trying to figure out how my .hmf and .tht files should look for a mesh only track (because originally I was using a heightmap just below my .edf objects). But of course now I don't want to use my heightmap.raw or any of those parameters. I just want my SURFACE.map and COLLISION.trp files to be the main track base.

samples_x = 4097
samples_z = 4097

data = heightmap.raw

size_x = 700
size_z = 700
scale = 100

num_layers = 3
layer0
{
map = maps/mud_treads.tga
frame1
{
map = maps/mud_treads_wet.tga
}
repetitions = 50
}

layer1
{
map = maps/mud.tga
frame1
{
map = maps/mud_wet.tga
}
repetitions = 50
thickness = 0.1
}

layer2
{
map = maps/SAT_colornear001.tga
frame1
{
map = maps/SAT_colornear001.tga
}
repetitions = 1
mask = mask_color.tga
thickness = 0.4
}

scene0
{
name = OBJ_SURFACE.edf
pos
{
x = 0
y = 0
z = 0
}
rot
{
x = 0
y = 0
z = 0
}
}

scene1
{
name = OBJ_BUILDINGS.edf
pos
{
x = 0
y = 0
z = 0
}
rot
{
x = 0
y = 0
z = 0
}
}

scene2
{
name = OBJ_TYRESTACKS.edf
pos
{
x = 0
y = 0
z = 0
}
rot
{
x = 0
y = 0
z = 0
}
}

scene3
{
name = OBJ_2DTREES.edf
pos
{
x = 0
y = 0
z = 0
}
rot
{
x = 0
y = 0
z = 0
}
}

scene4
{
name = OBJ_3DTREES.edf
pos
{
x = 0
y = 0
z = 0
}
rot
{
x = 0
y = 0
z = 0
}
}

scene5
{
name = OBJ_MARKERS.edf
pos
{
x = 0
y = 0
z = 0
}
rot
{
x = 0
y = 0
z = 0
}
}

scene6
{
name = OBJ_BARRIERS.edf
pos
{
x = 0
y = 0
z = 0
}
rot
{
x = 0
y = 0
z = 0
}
}

EDIT: Actually I have managed to compile my map without running TERRAINED at all.  I just used TrackED to take the collision file and merge with my centerline, deleted my .TRH in my output and replaced with my new .TRP. Dropped in my .MAP file of my surfaces and ran the track. But now I have a new problem...  The grass is on every surface named TRKGRAS_ and doesn't seem to obey the .GRS files, nor the DENSITY maps. In fact even when I remove the Grassfx.tga file I still have grass on my surfaces! Eeek. I'm a bit confused.