BVE WorldWide
Would you like to react to this message? Create an account in a few clicks or log in to continue.

The Face and Face2 Commands

+4
leezer3
Stevegr
Quork
SP1900
8 posters

Go down

The Face and Face2 Commands Empty The Face and Face2 Commands

Post by leezer3 Fri Nov 30, 2018 12:23 pm

At the risk of wandering off topic, Face2 will have absolutely no affect on the speed of rendering a model.

The things that affect rendering speed are as follows:
* Number of vertices
* Number of unique textures in the model
* Texture size
* Transparency / alpha

leezer3

Posts : 1802
Join date : 2011-08-23

http://www.bvecornwall.co.uk

Back to top Go down

The Face and Face2 Commands Empty Re: The Face and Face2 Commands

Post by SP1900 Fri Nov 30, 2018 1:36 pm

leezer3 wrote:At the risk of wandering off topic, Face2 will have absolutely no affect on the speed of rendering a model.

The things that affect rendering speed are as follows:
* Number of vertices
* Number of unique textures in the model
* Texture size
* Transparency / alpha

Ok thanks for clearing this up.

Then I think I know exactly what I’ve done wrong with the interior fitting of the 168. Might be too many textures, I’ll have to do a little bit of remodelling
SP1900
SP1900

Posts : 264
Join date : 2017-12-08
Age : 19
Location : Cambridge, England

Back to top Go down

The Face and Face2 Commands Empty Re: The Face and Face2 Commands

Post by Quork Fri Nov 30, 2018 3:54 pm

Has this been changed, Chris? I've been told many times that Face2 hits performance and is generally bad.
Quork
Quork

Posts : 1395
Join date : 2012-05-05
Age : 30
Location : Hofheim a.T., Hessen (Hesse), European Union

Back to top Go down

The Face and Face2 Commands Empty Re: The Face and Face2 Commands

Post by Stevegr Fri Nov 30, 2018 6:47 pm

leezer3 wrote:At the risk of wandering off topic, Face2 will have absolutely no affect on the speed of rendering a model.

The things that affect rendering speed are as follows:
* Number of vertices
* Number of unique textures in the model
* Texture size
* Transparency / alpha

Well I did check that out by making the same thing in Face only and Face2 and found no change in frame rates.

The rest I am guilty of using a lot!

Quork wrote:Has this been changed, Chris? I've been told many times that Face2 hits performance and is generally bad.

That's the same as putting an overlay on a model 0.005 from what it's overlaying to stop them fighting each other!

I could say were things like that came from, but I better not.

Stevegr

Posts : 180
Join date : 2013-01-01

Back to top Go down

The Face and Face2 Commands Empty Deleted

Post by Movingmillion Fri Nov 30, 2018 6:59 pm

Deleted


Last edited by Movingmillion on Sun Feb 09, 2020 2:00 am; edited 1 time in total

Movingmillion

Posts : 283
Join date : 2013-04-13

Back to top Go down

The Face and Face2 Commands Empty Re: The Face and Face2 Commands

Post by leezer3 Fri Nov 30, 2018 7:02 pm

Quork wrote:Has this been changed, Chris? I've been told many times that Face2 hits performance and is generally bad.

No, never in the life of openBVE at least.
Can't speak for BVE2 / BVE4, but all Face2 really does is toggle an openGL flag.

I'll admit I'm guilty of the overlay trick mind.

Will split this thread once home from work if it's not been done already, as we're seriously O/T now.

leezer3

Posts : 1802
Join date : 2011-08-23

http://www.bvecornwall.co.uk

Back to top Go down

The Face and Face2 Commands Empty Re: The Face and Face2 Commands

Post by leezer3 Fri Nov 30, 2018 7:08 pm

Movingmillion wrote:What exactly is the difference between face and face2? I'm not really sure.
Face2 is visible from both directions, Face is only visble when viewing from the clockwise direction.

More specifically, Face2 turns off Backface Culling in openGL when drawing a Face.

leezer3

Posts : 1802
Join date : 2011-08-23

http://www.bvecornwall.co.uk

Back to top Go down

The Face and Face2 Commands Empty Re: The Face and Face2 Commands

Post by thehoviskid Fri Nov 30, 2018 10:51 pm

leezer3 wrote:At the risk of wandering off topic, Face2 will have absolutely no affect on the speed of rendering a model.

The things that affect rendering speed are as follows:
* Number of vertices
* Number of unique textures in the model
* Texture size
* Transparency / alpha
So, if you were to have a larger that usual texture for an entire exterior, (say, 2048x1024) but only one, would you expect better performance (less textures) or worse (larger texture)?
thehoviskid
thehoviskid

Posts : 146
Join date : 2011-07-09
Age : 43
Location : Heysham

Back to top Go down

The Face and Face2 Commands Empty Re: The Face and Face2 Commands

Post by Dexter Sat Dec 01, 2018 8:56 am

Face2 is not recommended not because of performance, but because of incorrectly assuming the lighting of the face generated this way.
Instead of Face2:
AddFace, 0,1,2,3
AddFace, 3,2,1,0
Dexter
Dexter

Posts : 2110
Join date : 2011-07-08
Age : 35
Location : Brno, Czech republic

http://www.brnobve.eu

Back to top Go down

The Face and Face2 Commands Empty Re: The Face and Face2 Commands

Post by Dexter Sat Dec 01, 2018 9:00 am

thehoviskid wrote:So, if you were to have a larger that usual texture for an entire exterior, (say, 2048x1024) but only one, would you expect better performance (less textures) or worse (larger texture)?

Bigger texture = more memory needed from your GPU. It has to load the entire thing to work with it. As long as the number of vertices is the same, the computing part should not be affected that much.

In general:
Texture size -> GPU memory consumption.
Texture count -> Both memory and computing impact.
Number of Vertices (faces) -> computing demands.
Dexter
Dexter

Posts : 2110
Join date : 2011-07-08
Age : 35
Location : Brno, Czech republic

http://www.brnobve.eu

Back to top Go down

The Face and Face2 Commands Empty Deleted

Post by Movingmillion Sat Dec 01, 2018 10:39 am

Deleted


Last edited by Movingmillion on Sun Feb 09, 2020 2:00 am; edited 1 time in total

Movingmillion

Posts : 283
Join date : 2013-04-13

Back to top Go down

The Face and Face2 Commands Empty Re: The Face and Face2 Commands

Post by leezer3 Sat Dec 01, 2018 10:48 am

thehoviskid wrote:
leezer3 wrote:At the risk of wandering off topic, Face2 will have absolutely no affect on the speed of rendering a model.

The things that affect rendering speed are as follows:
* Number of vertices
* Number of unique textures in the model
* Texture size
* Transparency / alpha
So, if you were to have a larger that usual texture for an entire exterior, (say, 2048x1024) but only one, would you expect better performance (less textures) or worse (larger texture)?

It's more complex than Dexter's statement above.

Your texture example takes account of the following factors:
* Total texture size in GPU memory (Width x Height x 32 bits per pixel); Note that this is different to the on-disk size.
* Number of switches between textures. In general, if multiple faces within a model share the same texture, they can be batched into a single draw call, whereas others cannot.

As you combine more textures into the whole, you add more draw calls to the batch, and so the speedup from this will be exponential based upon the number of combined textures.
This has to be balanced against the cost of loading the larger texture into memory.
In real terms, assuming the single texture is less than or equal to the size of the combined ones, it will be marginally faster, but whether or not this is actually noticable depends on the size of the model and number of textures it replaces.

Updating the vertices is a *much* slower operation.

leezer3

Posts : 1802
Join date : 2011-08-23

http://www.bvecornwall.co.uk

Back to top Go down

The Face and Face2 Commands Empty Re: The Face and Face2 Commands

Post by graymac Sat Dec 01, 2018 11:00 am

Ah. So a good way to save frames and performance is to have smaller, but more textures?

The number of textures needed will depend on the item(s) being produced. It's a balancing act of detail vs. performance. It is incumbent on the developer to keep the bitmap count to the lowest number and the bitmap size to the lowest resolution - all compatible with ending up with sufficient visual detail.
Always ask yourself, as you start coding yet another mesh, "Is this necessary?"
(I find train interiors frequently beguile makers into add a lot of needless stuff - just because you CAN doesn't equate to because you SHOULD  Razz )
And often, a smaller texture will work just as well as that big one you thought you needed. Novices should try substituting reduced scale copies and running it to see any difference.
graymac
graymac

Posts : 2127
Join date : 2011-08-28
Location : Co Mayo, Eire

http://www.celtictrainsim.com

Back to top Go down

The Face and Face2 Commands Empty Re: The Face and Face2 Commands

Post by thehoviskid Sat Dec 01, 2018 8:09 pm

So with sensible coding there's not a massive difference between the two, and it should be a case of swings and roundabouts?  

I suppose there's two opposite-end-of-the-spectrum cases- Steve tends to use smaller bits of mesh with their own texture, but putting that all onto one larger texture (like a set of stickers) and referencing the bit of that texture by coordinates would wipe out any gain, by virtue of being a larger texture?  

To make any sort of noticeable gain, would you have to combine both the textures (easy) into one image and the code for the object (far from easy) into a single mesh, set of face, and texture coordinates rather than one file with separate meshes in it?  But one or the other isn't going to make a staggering difference?

Now, that would be tricky to get your head around spatially!
thehoviskid
thehoviskid

Posts : 146
Join date : 2011-07-09
Age : 43
Location : Heysham

Back to top Go down

The Face and Face2 Commands Empty Re: The Face and Face2 Commands

Post by Dexter Sun Dec 02, 2018 7:09 pm

leezer wrote:
It's more complex than Dexter's statement above.

I was referring to side as in height and width, not the file size. Probably should have gone for the word "dimensions".
Dexter
Dexter

Posts : 2110
Join date : 2011-07-08
Age : 35
Location : Brno, Czech republic

http://www.brnobve.eu

Back to top Go down

The Face and Face2 Commands Empty Re: The Face and Face2 Commands

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum