Lofted terrain transparency: possible or not?

Are you thinking about building your own route? or are you already in progress? Talk to the experts in here and find out the best way to do things!

Moderator: Moderators

Locked
User avatar
CosmicDebris
Been on the forums for a while
Posts: 285
Joined: Mon May 28, 2007 1:51 am
Location: France

Lofted terrain transparency: possible or not?

Post by CosmicDebris »

Hi there,

I was wondering if it was possible to make nice cuttings with near vertical sides, like at 3:28 (or 1:22) in the video below:

http://www.youtube.com/watch?v=NUQbTpuiZNQ

When I try to make some using the dedicated terrain modelling tool I get very rough edges and surfaces because of too big terrain polygons.

A lofted cutting seems to be the obvious way to go, but this would be useless without something like a "lofted transparency decal" that could be laid coincident with the cutting (offset tool with zero metre value), in order to mask the terrain between both sides of the cutting.

This is however only theory. Has someone achieved something like this? Is it only possible?

Thanks in advance for your tips.
User avatar
antonyperks
Very Active Forum Member
Posts: 1631
Joined: Wed Aug 26, 2009 8:14 pm
Location: Charfield DGL

Re: Lofted terrain transparency: possible or not?

Post by antonyperks »

Barn Rs look him up in the down loads bit there is a free ware asset pack there with some great embankements and cuttings also a really good retaining wall too and even some flat terraces, the near verticals you require are cutting X if i remember correctly. They shown in the flyout as Lpl........
AMD A8-7650K, 64Bit win 10, 240GB SSD-TS2016,Nvidia GTX 960 2GB, 1TB HD,750W Psu, 19" AOC Monitor.
User avatar
CosmicDebris
Been on the forums for a while
Posts: 285
Joined: Mon May 28, 2007 1:51 am
Location: France

Re: Lofted terrain transparency: possible or not?

Post by CosmicDebris »

antonyperks wrote:Barn Rs look him up in the down loads bit there is a free ware asset pack there with some great embankements and cuttings also a really good retaining wall too and even some flat terraces, the near verticals you require are cutting X if i remember correctly. They shown in the flyout as Lpl........
Thanks for the info. I've tried to find the package, but I just came across those links that all appear to be broken:
http://rapidshare.com/files/149346832/B ... kage_1.rpk
http://www.class50-hoover-bashers.co.uk ... kage_1.rpk

I didn't find it in the UKTS download section, either.

I've just sent a PM to Paul (higherbrimley).
User avatar
pjt1974
Very Active Forum Member
Posts: 3800
Joined: Tue Feb 09, 2010 8:30 pm
Location: Ballaugh Isle of Man
Contact:

Re: Lofted terrain transparency: possible or not?

Post by pjt1974 »

I can't remember where I downloaded the LPL embankments and cutting from. I think I got most of them through downloading Brendan's Cork - Dublin route and it's assets. I acquired the rest through downloading another routes assets but I can't remember which one at the moment.
Have a search in the Rail Simulator section of the downloads aswell, I'm sure they were available for RS before RW but don't quote me on that, I've been known to be wrong before.
hope this helps
Phil
For disclosure, I am affiliated with a third party developer however, I do not know anything about any future releases unless I'm working on them and even then, I'd be breaking years worth of built up trust to say anything about it ;-)
jaapsloot
Been on the forums for a while
Posts: 193
Joined: Fri Mar 21, 2008 6:39 pm
Location: Enschede, The Netherlands
Contact:

Re: Lofted terrain transparency: possible or not?

Post by jaapsloot »

User avatar
CosmicDebris
Been on the forums for a while
Posts: 285
Joined: Mon May 28, 2007 1:51 am
Location: France

Re: Lofted terrain transparency: possible or not?

Post by CosmicDebris »

Thanks for the link, it works!

-------------------

I've tried the various cuttings and while they are very nice, it's hard to make them match the terrain where the textures differ. So my question is still valid: is terrain transparency (a la Tunnel Hole Decal) "loftable"?
User avatar
antonyperks
Very Active Forum Member
Posts: 1631
Joined: Wed Aug 26, 2009 8:14 pm
Location: Charfield DGL

Re: Lofted terrain transparency: possible or not?

Post by antonyperks »

short answer then...........No., glad you found the link , some of the lpl texture i think dry grass and green match the kuju textures fine, well at least to my color blind eyes they do :D and sorry that wasnt what you wanted.
AMD A8-7650K, 64Bit win 10, 240GB SSD-TS2016,Nvidia GTX 960 2GB, 1TB HD,750W Psu, 19" AOC Monitor.
User avatar
longbow
Very Active Forum Member
Posts: 3608
Joined: Mon Mar 18, 2002 12:00 am
Location: Noosa, Australia
Contact:

Re: Lofted terrain transparency: possible or not?

Post by longbow »

So my question is still valid: is terrain transparency (a la Tunnel Hole Decal) "loftable"?
If the terrain transparency is applied with a custom shader then I guess it could be applied to custom assets or lofts, but I've never seen this documented. It would be very useful to be able to apply terrain transparency directly to custom objects such as tunnel mouths or inspection pits rather than fiddling with a decal.

I'm not so clear how you would use it for a lofted cutting shape where it seems to me the main problem would be how to adjust the top of the cutting along its length to match the terrain. Texture matching is less of an issue if you don't mind having a number of lofts to match the terrain textures; in any case in real life there is often a contrast between the two.
User avatar
CosmicDebris
Been on the forums for a while
Posts: 285
Joined: Mon May 28, 2007 1:51 am
Location: France

Re: Lofted terrain transparency: possible or not?

Post by CosmicDebris »

antonyperks wrote:short answer then...........No., glad you found the link , some of the lpl texture i think dry grass and green match the kuju textures fine, well at least to my color blind eyes they do :D and sorry that wasnt what you wanted.
Don't be sorry: the LPL are quality assets! I don't know if I'll use them in a route someday, but they will be useful when I try a route that uses them.
longbow wrote:
So my question is still valid: is terrain transparency (a la Tunnel Hole Decal) "loftable"?
If the terrain transparency is applied with a custom shader then I guess it could be applied to custom assets or lofts, but I've never seen this documented. It would be very useful to be able to apply terrain transparency directly to custom objects such as tunnel mouths or inspection pits rather than fiddling with a decal.

I'm not so clear how you would use it for a lofted cutting shape where it seems to me the main problem would be how to adjust the top of the cutting along its length to match the terrain. Texture matching is less of an issue if you don't mind having a number of lofts to match the terrain textures; in any case in real life there is often a contrast between the two.
You had a very interesting idea! Though I'm no expert, I guess you could have:
  1. one or more shaders dedicated to terrain texturing (every existing shader could virtually have its "Terrain" version with e.g. a "Terrain" flag set to 1), let's call it TerrainTexture.fx
  2. a shader that makes every terrain texture behind it transparent (i.e. any pixel coming from a shader with "Terrain" flag set to 1 isn't rendered), let's call it NoTerrain.fx
In pseudocode you would have something like this:

Code: Select all

function DrawAPixel
  set BypassTerrain to false
  for polygon from the closest to the farthest do
    if polygon_shader = NoTerrain.fx then
      set BypassTerrain to true
    else if ( polygon_shader = TerrainTexture.fx and not BypassTerrain ) or polygon_shader = AnyStandardShader.fx then
      do AddPolygonPixelToResult
    end if
    if ResultingTransparency = 0 then break   <--- code optimisation unneeded for explanatory purposes :)
  end for
  DrawResult
end function
So every time a polygon with NoTexture.fx applied to it passes between the terrain and the camera, the only shaders taken into account will be the standard ones (those with the "Terrain" flag set to 0), whatever their position in the line of sight relative to the camera and the polygons of the terrain.

As for your second paragraph, I think the issue could be addressed by making the loft of the cutting follow the terrain instead of the track. Of course this will be valid only for cuttings with near vertical sides or moderate depth. Note that the cutting loft could be modelled with a "roof" at 0.1m level, a roof made of polygons "shaded" with NoTerrain.fx.

Your thoughts?
Locked

Return to “[RW] Route Building”