Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (Akow, TipmyPip, tomaslolo), 788 guests, and 11 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19055 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Face Rendering #280771
07/24/09 07:57
07/24/09 07:57
Joined: May 2009
Posts: 258
Chicago
J
Jaeger Offline OP
Member
Jaeger  Offline OP
Member
J

Joined: May 2009
Posts: 258
Chicago
Hey guys, I've just got a question about the way the engine renders things...

Wanted I wanted to know the way faces are rendered and culled for a model. For example, let's take one of my gun models for example. I've built it almost totally to historical specs, making only reasonable compromises on poly count. I've got quite a bit of detail inside the breech, inside the magazine, and a few other places. When the player is using the gun, they will only being seeing the left side, for the most part, and very little of the butt, and none of the internal parts. The internal parts are only exposed during reloading.

So, during the majority of game play, when none of the internal parts or the butt are showing, do those polies get rendered by the engine? Or does the engine only render what the camera can directly see?

If my example doesn't make sense to you, just say you have a model of a garbage can with a lid on it. There is a bunch of garbage modeled inside of the can, but can only be seen when the lid is opened during animation (all part of the same mesh). So is the garbage actually rendered the whole time, or only when the lid is off to expose it?

I hope this makes sense. I really need to know this, to get a better idea of how detailing certain parts of our weapons can adversely effect performance (or not). If the engine does indeed cull the unexposed parts, that is great.

I really need a CERTAIN answer, from someone who knows for sure. This is going to dictate the way our artwork is done, so please don't speculate or pretend you know. smile

Thanks!

Re: Face Rendering [Re: Jaeger] #280795
07/24/09 09:16
07/24/09 09:16
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Best to wait for an expert opinion on this,
but AFAIK, the 'hidden' polys DONT get rendered,
but the textures of those polys still consume video memory.


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: Face Rendering [Re: EvilSOB] #280805
07/24/09 09:55
07/24/09 09:55
Joined: May 2009
Posts: 258
Chicago
J
Jaeger Offline OP
Member
Jaeger  Offline OP
Member
J

Joined: May 2009
Posts: 258
Chicago
That's kind of what I've been figuring. I'm also really curious about edge smoothness. I've exported models from Maya, for instance, two spheres; one using soft edges and the other with hard edges. It appears that the engine just takes everything to be soft edges. That's going to be a major problem. smirk Maybe I'm exporting with the wrong options? Is there a particular format I must use to preserve it?

Re: Face Rendering [Re: Jaeger] #280812
07/24/09 10:26
07/24/09 10:26
Joined: Nov 2007
Posts: 1,143
United Kingdom
DJBMASTER Offline
Serious User
DJBMASTER  Offline
Serious User

Joined: Nov 2007
Posts: 1,143
United Kingdom
This process you describe is known as 'backface culling'. The rendering engine tests the polygon's vertices and determines if they are clockwise or anti-clockwise. The engine can say that polygons that are set as 'clockwise' are facing the camera and so render them. Any polygon which is determined to be 'anti-clockwise' will not be rendered.

Re: Face Rendering [Re: Jaeger] #280816
07/24/09 10:35
07/24/09 10:35
Joined: Mar 2006
Posts: 3,538
WA, Australia
J
JibbSmart Offline
Expert
JibbSmart  Offline
Expert
J

Joined: Mar 2006
Posts: 3,538
WA, Australia
The internals are DEFINITELY being rendered as well. Well, sort of -- it depends on the order in which the polygons are rendered, but they'll still be translated into screen-space, and anything else the vertex-shader does will be done.

Basically, the engine just can't know prior to rendering which faces are obscured by other faces. What it does is reject pixels that are behind what has already been rendered. The internals of your gun might get rendered first and then covered up, or they might attempt to get rendered last and rejected, but either way they can't be ignored and still require vertex calculations, and still add overhead.

With your second problem, DirectX cannot differentiate between hard and soft edges. If you want hard edges you need to split them so the faces are not actually connected to each other.

I hope this is helpful!

Jibb

EDIT: Pixel shaders are often relatively expensive, and those pixels that get rejected early do get to skip this stage. I think that the engine deals with faces in the order they were created in the model file, so you can guarantee the internals will be rendered last if you can put them last in the file (perhaps by cutting and pasting them exactly as they were). This is an improvement but still wasteful, though, as far as vertex calculations go, so I would highly recommend having no internals when possible.

Last edited by JulzMighty; 07/24/09 10:44. Reason: But if you really want to...

Formerly known as JulzMighty.
I made KarBOOM!
Re: Face Rendering [Re: JibbSmart] #280837
07/24/09 11:53
07/24/09 11:53
Joined: May 2009
Posts: 258
Chicago
J
Jaeger Offline OP
Member
Jaeger  Offline OP
Member
J

Joined: May 2009
Posts: 258
Chicago
No DJ, I know what backface culling is. Julz gave the answer I was looking for.

Thank you though, Julz. I've been wondering about his. I was unaware that DX could not differentiate between hard and soft edges though. Wow. I wonder why that is? I assumed Maya's editor window was using DX for the 3D display. I guess it's going to be difficult to make complex geometry look like we want it, but it's not the end of the world. smirk

By internals, I don't mean I've modeled every part of the gun, like springs, the internal trigger grouping, etc. I'm modeling the parts of the gun's breech internals that are exposed when reloading or when you run out of ammo. It's really evident with the Gewehr-43, as its mechanism actually locks the breech open when the magazine is empty (like most pistols do).

You can see what I mean here:

[video:youtube]http://www.youtube.com/watch?v=hVyRk1rL3RY[/video]

Pffft... Can't embed youtube for some reason, wtf! lol..

The player using the gun is going to be able to see all that stuff very clearly, which is why I've modeled it. Reality bytes! smile


Last edited by Jaeger; 07/24/09 11:56.
Re: Face Rendering [Re: Jaeger] #280867
07/24/09 13:25
07/24/09 13:25
Joined: Mar 2006
Posts: 3,538
WA, Australia
J
JibbSmart Offline
Expert
JibbSmart  Offline
Expert
J

Joined: Mar 2006
Posts: 3,538
WA, Australia
Glad I could be helpful smile
Quote:
I was unaware that DX could not differentiate between hard and soft edges though. Wow. I wonder why that is? I assumed Maya's editor window was using DX for the 3D display. I guess it's going to be difficult to make complex geometry look like we want it, but it's not the end of the world.
It probably does one of two things: separates the faces automatically when you make them hard (and marks them in some way to differentiate between those vertices and others that are intentionally separated, so there are no issues if you make it smooth again), or separates the faces just before rendering.
Quote:
By internals, I don't mean I've modeled every part of the gun, like springs, the internal trigger grouping, etc.
Don't worry, I didn't think so!

I can totally understand why some internals are desirable, as you've mentioned. Most first person shooters give the player a much higher-detailed version of each weapon than the NPCs -- this is more than just LoD in most cases, since the non-first-person version of the weapon usually doesn't get to that uber-high level of detail no matter how close you get (though there's no reason why you couldn't).

I was thinking similarly with your tanks in the Projects forum -- a tank's internals shouldn't even exist unless the player is about to enter it.

Jibb

EDIT: btw, "reality bytes" would make for a good signature smile

Last edited by JulzMighty; 07/24/09 13:25.

Formerly known as JulzMighty.
I made KarBOOM!
Re: Face Rendering [Re: JibbSmart] #281032
07/25/09 05:53
07/25/09 05:53
Joined: May 2009
Posts: 258
Chicago
J
Jaeger Offline OP
Member
Jaeger  Offline OP
Member
J

Joined: May 2009
Posts: 258
Chicago
Yes, we're using two different models for 1st person weapons and the weapons other players will see in 3rd person. You don't need to see huge amounts of detail on someone else's gun. It would be rather silly.

Yeah, that's also how we're going to handle the interiors of vehicles. It only exists on the client's PC who is entering or inside the vehicle. When you exit the vehicles, the memory will be deallocated. We ARE going to allow players to join vehicles "on the fly", just by walking up to them and pressing a button. It's just going to be difficult for us to do actual 3rd person animations for other people to see, due to the diversity of vehicles the game will offer. You have to get into every one of them differently. So, we're going to end up needed a very good character modeler and animator to do this. We'll probably make some invisible nodes on the vehicles to guide animations, so it will look correct. In first person the camera will probably follow a simple arc before tilting down and going into the vehicle. We could kinda "cheat" a little bit, by forcing those 3rd person animations to always work from the same position, as the player entering won't be seeing it anyway. If you manage to shoot an enemy who's trying to enter/exit a vehicle, it will send that info from client to server and kill the person, even though they weren't *really* where you saw them. It's a small thing, and it should be unnoticeable. But it would dodge some major problems with a vehicle crewing system.

Lol, I think I will make that my sig though. smile


Moderated by  HeelX, Spirit 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1