Looking from downhill

Jules Robichaud Gagnon

04-12-2007 19:18:09

Yo JohnJ,

I noticed when looking from downhill the billboards go through the terrain and we cant see part of them.

We can see it clearly with the trees in the middle :
http://www.wendigostudios.com/Temp/downhilltrees.wmv

JohnJ

05-12-2007 15:46:38

Hmm... that's an interesting problem. Since tree billboards pivot around the middle, the lower half rotates and intersects the terrain in some extreme cases (like a steep hill :) ). Of course this can be solved fairly easily in the shader by moving the pivot to the bottom, but I hope Ogre's BillboardSet can do this too, otherwise keeping support for fixed-function will be difficult. I'll see what I can do.

Jules Robichaud Gagnon

05-12-2007 16:04:07

You are my hero :mrgreen:

JohnJ

12-12-2007 03:55:42

Just to let you know, I basically have bottom-pivoted impostors working now in both fixed-function and shader-based billboards (sorry it took so long - the Christmas season is always a little busy here :) ). I think I'm going to make them optional, because in some cases they intersect the terrain when looking down from far above (kind of the inverse problem before - I may be able to make a hybrid to solve both problems, although it won't work in fixed-function). I should be able to finish it in a few more days - hopefully it will solve your problem.

Jules Robichaud Gagnon

12-12-2007 03:58:20

Oh my gord, you are fast. :shock:

Question, will that be active only when looking from downhill ?

JohnJ

12-12-2007 04:02:33

Question, will that be active only when looking from downhill ?
It doesn't really matter, because the only time you will notice the difference is when you're looking down/up-hill. The technique looks good when looking down a hill from above or up a hill from below, but the problem I'm working on now is that looking down at the side of a hill from an altitude can cause the trees to become flat against the hill, and intersect.

One way to solve the problem is to make the bottom-pivoting billboards an optional mode (which would probably work well for your game), but I'm going to spend a little time trying to find a way to make it automatically work in every case with no adjustment necessary. The only problem with this it might be hard to implement in fixed-function.

Jules Robichaud Gagnon

12-12-2007 04:03:47

Good work JohnJ.

JohnJ

13-12-2007 23:40:46

Ok, try the CVS now. The billboard pivot mode is configurable through ImpostorPage::setImpostorPivot(). In your case you'd want to call:
ImpostorPage::setImpostorPivot(BBO_BOTTOM_CENTER);

Let me know if it solves your problem :)

Jules Robichaud Gagnon

14-12-2007 14:52:46

www.wendigostudios.com/Temp/imposterpro ... lunder.wmv

It causes a new problem, the trees fall in the snow. :shock:

The pivot of my trees are at the base of the trees, could that cause a problem?

JohnJ

14-12-2007 23:49:49

It causes a new problem, the trees fall in the snow.
Strange. It almost looks like the base-pivoting impostors aren't working properly (it looks like the impostors have a height offset and don't match up to the actual tree mesh).

The pivot of my trees are at the base of the trees, could that cause a problem?
It shouldn't - impostors are rendered independently of where the models actual (0,0,0) is. All the trees I've tried are based at the bottom, and they worked fine.

It's hard to tell just what's wrong with the video, but I forgot to mention that ImpostorPage::setImpostorPivot() should be called before PagedGeometry first starts rendering the first frame. This probably isn't the problem, but it's worth a try.

Jules Robichaud Gagnon

15-12-2007 21:31:49

It's hard to tell just what's wrong with the video, but I forgot to mention that ImpostorPage::setImpostorPivot() should be called before PagedGeometry first starts rendering the first frame. This probably isn't the problem, but it's worth a try.

I called this before the paged geometry was created.

JohnJ

15-12-2007 21:43:29

I called this before the paged geometry was created.
Then that's not the problem.

From the video, it looks like the tree impostors are sunk down into the terrain about half way (is this correct?). I'll try to find what's causing this.

Jules Robichaud Gagnon

16-12-2007 19:38:53

From the video, it looks like the tree impostors are sunk down into the terrain about half way (is this correct?).

It looks like to me that the middle of the billboard was positioning itself at bottom center. :?

JohnJ

08-01-2008 00:12:15

Ok, try the CVS now. I think I reproduced the problem you're having and fixed it. There was bug in how the pivot point was calculated, and it was being incorrectly positioned vertically.

Sorry it took so long for me to get back to you on this. I sort of took a "vacation" from this project over the holidays so I could spend more time on my own hobby projects, but I'm back now so hopefully I'll be able to respond to bugs/feature requests ASAP again :D

Jules Robichaud Gagnon

08-01-2008 00:56:24

Now the forest is alive. :shock:

JohnJ

08-01-2008 01:30:36

Strange. It looks like there's a lack of alpha fading, even though both LOD's exist in the same place (which occurs when cross-LOD fading should be happening). How are you configuring the transitions?

Also it appears the the billboard isn't properly aligned with "up", maybe because of some sort of parallax effect. I'll investigate and see what may be causing this.

Jules Robichaud Gagnon

08-01-2008 20:48:27

World scale 1 ogre unit = 1 meter

Page Size 25
Batch Range 20
Impostor Range 5
Batch Transition 5
Impostor Transition 10


They were values i put for test to see the trees move very close.

I haven't really tweaked the PagedGeometry yet. I have my priorities somewhere else for the moment.

JohnJ

19-01-2008 00:19:26

I experimented with different ranges a little, and everything seems to work fine as far as I can tell.

I assume the numbers you posted are typos - the impostor range is closer than the batch range, which is invalid unless you want impostors close to the camera and batches far away (which is obviously not the case in your videos).

I should also mention that when you start using transition points so close to the camera that it's considerably less than your page size, you may get weird results. The impostors really weren't designed to be rendered less than one page size away.

Jules Robichaud Gagnon

21-01-2008 13:53:00

I experimented with different ranges a little, and everything seems to work fine as far as I can tell.

I assume the numbers you posted are typos - the impostor range is closer than the batch range, which is invalid unless you want impostors close to the camera and batches far away (which is obviously not the case in your videos).

I should also mention that when you start using transition points so close to the camera that it's considerably less than your page size, you may get weird results. The impostors really weren't designed to be rendered less than one page size away.



My bad, nice typo here. :shock:

What parameters for you looked "fine" or what would you recommand?

JohnJ

23-01-2008 18:11:13

Sorry I didn't respond earlier - as usual I was automatically logged out for some reason and didn't notice your post (since I usually look for the new post indicator instead of name of the last poster)

What parameters for you looked "fine" or what would you recommand?
I'd recommend a batch range of no less than your page size, and a batch transition no more than your page size (for performance). So if your page size was 25, a batch range of 25 with a transition of 10 should be fine.