Pherael
Member
|
Billboards not affected by Fog
As in thread subject. I'm using billboards for trees in distance but they looks very unnatural with fog.
(This post was last modified: 01-29-2015 08:25 PM by Pherael.)
|
|
01-28-2015 05:36 PM |
|
georgatos7
Member
|
RE: Billboards (3D Images) not affected by Fog
I can't help since i haven't tried anything like it but out of curiosity, do you have a pic?
I'm very interested my self for this, how is the performance for big numbers of trees?
|
|
01-29-2015 12:48 AM |
|
Pherael
Member
|
RE: Billboards (3D Images) not affected by Fog
Well, this is very very early version of randomly generated island (so doesn't looks very good) but sure:
With fog:
Over 1000 m distance view:
Well, using billboards give me great boost to performance. I add this functionality recently, so I still testing it. Hard to tell exactly numbers, there is many factors. For example, my billboards cast fake shadows, so they looks more naturally. I think this affect performance more than billboards itself. As for quick test I did now, even about 1000 billboards don't slow fps more than 1 fps.
I'll post some information about it later in Kill the Dragon thread.
(This post was last modified: 01-29-2015 11:11 AM by Pherael.)
|
|
01-29-2015 10:52 AM |
|
georgatos7
Member
|
RE: Billboards (3D Images) not affected by Fog
Wow man it looks amazing. I see the issue was that they are unaffected by fog.
I don't know how it works but maybe trying to draw them at a stage before the fog is applied. I'm just throwing an idea here.
|
|
01-29-2015 11:56 AM |
|
Pherael
Member
|
RE: Billboards (3D Images) not affected by Fog
When I try to draw them outside RM_BLEND stage, billboards were black squares (RM_PREPARE) or don't display at all (outside Renderer).
|
|
01-29-2015 12:35 PM |
|
Houge
Member
|
RE: Billboards (3D Images) not affected by Fog
One question. What happens when you look at the trees from the top?
Billboards shall face the camera, so it should make an effect of trees "lying on the ground", right?
|
|
01-29-2015 03:09 PM |
|
Pherael
Member
|
RE: Billboards (3D Images) not affected by Fog
Its happens only when you looking at them from top or from very high angle, but billboards are displayed always far from hero, so this is not a big problem. They looks good even from top of the mountain.
The biggest problem so far is transition from 3d object to billboard. This is (sometimes) very noticeable, but I have few ideas how fix it.
View from cliff with almost max player angle (I limited looking down to 45 degree)
(This post was last modified: 01-29-2015 04:03 PM by Pherael.)
|
|
01-29-2015 03:45 PM |
|
georgatos7
Member
|
RE: Billboards (3D Images) not affected by Fog
Awesome Pherael, the pics are looking very nice, also i really like the swore line. It blends the scene very well.
You said this billboard system is something you developed or is it built-in?
|
|
01-29-2015 07:57 PM |
|
Pherael
Member
|
RE: Billboards (3D Images) not affected by Fog
From Esenthel
Code:
// draw in 3D space
void draw3D(C Color &color, Flt size, Flt angle, C Vec &pos, ALPHA_MODE mode=ALPHA_BLEND_DEC)C; // draw as 3D billboard, this can be called in RM_BLEND mode or outside rendering function (in drawing function), this method supports only IMAGE_2D images, this relies on active object matrix which can be set using 'SetMatrix' function
|
|
01-29-2015 08:11 PM |
|
georgatos7
Member
|
RE: Billboards (3D Images) not affected by Fog
Nice, along with your nice trees it looks really well.
Edit : Y i can't see a way to apply fog to it, draw3D doesn't write to Depth buffer also if that has to do with anything.
(This post was last modified: 01-29-2015 10:01 PM by georgatos7.)
|
|
01-29-2015 08:21 PM |
|
georgatos7
Member
|
RE: Billboards not affected by Fog
Hey if you don't wanna bother making your own system you can maybe try to fade the billboards based on distance.
Code:
Image *billboardImage = Images(UID(...TREE...));
flt distance = Dist(treePos, Cam.matrix.pos);
flt density = 0.01f;
flt expFade = 255.0f / Pow(2.7182f, distance*density);
Clamp(expFade, 100.0f, 255.0f);
(*billboardImage).draw3D(Color(255, 255, 255, expFade), 5, 0, treePos);
Might look crappy though i don't know.
If it had something like another color value that you could lerp to it would have been awesome, maybe Esenthel can add this to the draw3d source.
(This post was last modified: 01-29-2015 10:51 PM by georgatos7.)
|
|
01-29-2015 10:33 PM |
|
Pherael
Member
|
RE: Billboards not affected by Fog
Thanks for you support.
I already wondered about fading, but I don't think it will work.
I'll wait for what Esenthel say, then decide what to do next.
|
|
01-29-2015 11:15 PM |
|
Esenthel
Administrator
|
RE: Billboards not affected by Fog
Hi,
I'll add this for next release through a new method VI.fog(true)
also you will get better performance when using VI for batched drawing
|
|
01-30-2015 01:31 AM |
|
Esenthel
Administrator
|
RE: Billboards not affected by Fog
Just commited this to Source Beta branch.
|
|
01-30-2015 02:07 AM |
|
Pherael
Member
|
RE: Billboards not affected by Fog
This is great news. As always, really appreciate it
Can't wait for next release.
|
|
02-04-2015 09:31 AM |
|