Hawthorn hedges

Re: Hawthorn hedges

Postby AndiS » Sat Feb 06, 2016 3:48 pm

I forgot to supply the theory & motivation behind it. Here we go.

Most distinguish near trees and distant ones. (I use tree, bush and shrub interchangeably here.) Near trees must look really good as they stand right at the track. The drivers see them from two opposite angles 90 % of the time, so non-rotating 2D trees would be an option if no one ever peeked out the side window.

I am not a fan of rotating trees (upright viewer-facing images of a complete plant) as I find it disturbing. In contrast, I find trees that are composed by many viewer-facing planes quite convincing. The only issue occurs in the moment in which one image goes before the other due to the rotational movement. The tree "comes to life" in an unnatural way, attracting attention to the visual deficit by the unexpected motion/change in the picture. This effect is defeated by shrinking the images so they don't overlap. But then you need a second row behind them and the relative movement of the parts as you pass by can be obvious/disturbing or not. This needs exploration in detail as it largely depends on the textures used.

For distant trees, one could get tempted to model them as solid balls of irregular shape. But the vertex distance would need to be near 1 pixel in the picture the player sees, so you really need a load of polygons. So for distant trees just like for near ones, you cannot avoid 2D stuff with alpha if you want to get the silhouette right. And the silhouette is what stands out. You will not note much of the texture inside the green area that represents the tree in the final picture, but where the tree has a brown or blue background, the observer will note every pixel at the border between tree and background.

One thing to note is that voxel shading is an old hat. It works by creating a 3D image from a stack of 2D images with transparencies. Imagine a stack of static images, spaced by 10 cm, representing a dissection of the tree at that height. If you look don't look straight from the side, but from somewhere above, the superimposition of all the slices will create a convincing 3D image, or so they say. The problem in our case is that you do look from the side. You could use upright images, but there will always be a case where you look at the plant from an side that looks really bad (i.e., where you see the stack of planes from the side).

That said, I see two options for plants of all sorts: Rotating parts and non-rotating.

Non-rotating versions are for another day and also not really new. In the case of a hedge, you would have a row of upright, static planes, spaced by 1 m, that show the dissection of the hedge at that place. The important parts are the outer 1 or 2 m. Stepped in from the outskirts of the hedge by some 2 m or 3, you need a solid shape that covers the cases in which you see the hedge from the side. You also need a plane that runs through the middle of the hedge and carries the image of the top part for those who view the hedge from the side. The solid part is optional, but I find it very important that at the bottom, the solid shape - or another semi-transparent plane - runs right to the margin of the hedge base. You see loads of 2D trees that look decent as long as you don't see their base, showing the very obvious border of the upright image and the totally different ground texture.

The rotating version combines the theoretical elegance of voxel shading with that of viewer-facing geometry. The downside is that both left and right halves of the texture are the outside ones at some point. This means that the texture can only show rather generic leaf-shaped dots without much orientation.

While voxel-based representations need the whole body to be filled with voxels, you can make it hollow when using view-facing quads. If the non-transparent area of the texture is rather small and/or the quads don't overlap, you will see through the near layer of quads. You will see the other quads that form the other side of the hedge for the bigger part of the area. You might want to have something in the middle of the hedge that is gapless and/or a bit darker like the inside parts of the bushes normally are.
AndiS
Top Link Driver!
 
Posts: 736
Joined: Wed Apr 09, 2014 5:48 pm
Has thanked: 268 times
Been thanked: 308 times

Re: Hawthorn hedges

Postby Pauls » Sat Feb 06, 2016 4:46 pm

would planes rotated horizontally and vertically help with the illusion ? I tried this but had problems with the shading changing with the angle viewed - I overcame this by making the texture very slightly transparent - this in turn gave a alpha sorting problem with distant objects and also wouldn't show in a asset block ! For every thought and solution there seems to be a negative problem - Trainz Speedtrees anyone ? :?

Cheers
Paul
Pauls
Driver
 
Posts: 435
Joined: Fri Apr 04, 2014 10:38 am
Has thanked: 460 times
Been thanked: 188 times

Re: Hawthorn hedges

Postby Pauls » Sat Feb 06, 2016 4:48 pm

Pauls wrote:would planes rotated horizontally and vertically help with the illusion ? I tried this but had problems with the shading changing with the angle viewed - I overcame this by making the texture very slightly transparent - this in turn gave a alpha sorting problem with distant objects and also wouldn't show in a asset block ! For every thought and solution there seems to be a negative problem - Trainz Speedtrees anyone ? :?

PS: I need realistic oak trees and hawthorne hedges for my Snells Nook diorama so if someone would figure this out by tomorrow it would be appreciated ! :lol:

Cheers
Paul
Pauls
Driver
 
Posts: 435
Joined: Fri Apr 04, 2014 10:38 am
Has thanked: 460 times
Been thanked: 188 times

Re: Hawthorn hedges

Postby AndiS » Sat Feb 06, 2016 7:51 pm

Have you tried turning the normal of the quad down? This is what people did for cruciform in MSTS. That way, you don't get sun light on it, so the lighting should not change as the thing rotates. That said, some people might like the fact that the quad is lit stronger when facing the sun because the other things are lit stronger in this perspective, too. Everyone to their taste, I'd say.

"planes rotated horizontally and vertically" will be what I use. Not upright viewer-facing but unconstrained viewer-facing.

You certainly need the binary type of alpha channel. (I never know whether that would be half of full transparency then). The version with the gradual alpha values, would be nice for soft margins but it never works. I guess this is a DX limitation or something. It happens in other games, too. You can only use it when you provide the background and control the drawing sequence.
AndiS
Top Link Driver!
 
Posts: 736
Joined: Wed Apr 09, 2014 5:48 pm
Has thanked: 268 times
Been thanked: 308 times

Re: Hawthorn hedges

Postby Pauls » Sat Feb 06, 2016 8:38 pm

Thanks Andi,

I'll try the trick with the Normal.

Cheers
Paul
Pauls
Driver
 
Posts: 435
Joined: Fri Apr 04, 2014 10:38 am
Has thanked: 460 times
Been thanked: 188 times

Re: Hawthorn hedges

Postby AndiS » Sat Feb 06, 2016 10:24 pm

A little update: I got the viewer-facing trick working but the alpha channel does not want to show.

Lessons learnt:

The quad must be upright, origin at bottom centre.
You must join all the quads or else the Blueprint Editor complains about too many nodes (and rightfully so).
Deleting the Hedge object is not necessary. You just make it not selectable in Blender and select the join of the quads before exporting.

Correction to previous post: Duplication is set to Verts on the parent, now the child.

The stupid thing now is that the transparent parts don't want to become transparent. In RWAceTool, when I click the View button, I can see the alpha channel correctly, so from Gimp to the TGA file, things are fine. In RWAceTool, I tried "no MipMaps" and "generate MipMaps", none of them helped. Also switching compression off did not help.

I have LRE-Compression is on in the TGA file but like I said, that seems to be ok.

For some reason, the texture is always taken from folder in which the .igs/.GeoPcDx resides, and not the textures subfolder, even though I specified //textures\Blob.tga as the image path, i.e., with the path into the subfolder. However, the texture shows, so this does not seem to be a problem either. It is just that the corners that ought to be transparent are black.

Any ideas what else can go wrong with this are welcome.
AndiS
Top Link Driver!
 
Posts: 736
Joined: Wed Apr 09, 2014 5:48 pm
Has thanked: 268 times
Been thanked: 308 times

Re: Hawthorn hedges

Postby VictoryWorks » Mon Feb 08, 2016 12:39 pm

Hey Andi. In your IGSExpModFile2 file try adding:

[Materials:AlphaTestMode]
MyMaterial=1
User avatar
VictoryWorks
Driver
 
Posts: 333
Joined: Mon Apr 07, 2014 1:22 pm
Has thanked: 41 times
Been thanked: 224 times

Re: Hawthorn hedges

Postby Pauls » Mon Feb 08, 2016 3:52 pm

When I have dds files of the same name as other texture files in the textures folder the blueprint editor always chooses the dds file - this always confuses me when I've forgot the dds is there because it seems as if the blueprint editor and rw stops responding to my texture changes. Hope this is of help to someone.

Cheers
Paul
Pauls
Driver
 
Posts: 435
Joined: Fri Apr 04, 2014 10:38 am
Has thanked: 460 times
Been thanked: 188 times

Re: Hawthorn hedges

Postby AndiS » Mon Feb 08, 2016 9:25 pm

VictoryWorks wrote:Hey Andi. In your IGSExpModFile2 file try adding:

[Materials:AlphaTestMode]
MyMaterial=1

Eureka!

Guess what, it did not work until I noticed the 2 at the end of the filename. Adding this to IGSExpModFile did not do the trick.

I had even downloaded the latest exporter version. And ticked several options regarding transparency & alpha in Blender.

Thanks a lot. I would not have guessed that altering these files (or having IGSExpModFile2 at all) would be required. This betrays the simplicity of the stuff I created in the past. Off to redoing the whole experiment in a version that is worth showing!


P.S.: Paul, I was about to resort to DDS (again) as there, I know how to set the various transparency modes with certainty. But it turned out that the texture is not to blame.
AndiS
Top Link Driver!
 
Posts: 736
Joined: Wed Apr 09, 2014 5:48 pm
Has thanked: 268 times
Been thanked: 308 times

Re: Hawthorn hedges

Postby AndiS » Tue Feb 09, 2016 10:59 pm

More findings:

Having the spacing of the quads equal their size is not a good idea. Now I use 2 m spacing for a 3.6 m quad.
Making it double-sided is a waste of time.
Applying the modifiers is not required (or so it seems).
Making a copy of the quad before you parent it to the hedge is a good idea. That way, you can take a second round if you did not like the first results.

I still need to play with the displacement more aggressively. I hate the flat top.
It is very well possible that the vertical (or any) displacement does not show in the model. I.e., I need to check again, and play with the values a bit more.

To illustrate the process, I include the base shape below. It is not exported, only the dupliverts "made real" are, i.e., the copies of the quad that are placed on all the vertices of the shape "Hedge" shown.

I exported a copy of the Hedge shape sans modifiers as a collision geometry, but have not tested yet whether that makes it easily selectable or not. It should.
Attachments
Blob2.jpg
The texture.
HedgeInBlender.jpg
The base shape. On the vertices of this, the quads showing the texture are placed.
HedgeInGame.jpg
The Hedge in Game.
AndiS
Top Link Driver!
 
Posts: 736
Joined: Wed Apr 09, 2014 5:48 pm
Has thanked: 268 times
Been thanked: 308 times

PreviousNext

Return to 3D Objects General

Who is online

Users browsing this forum: No registered users and 3 guests