1 registered members (TipmyPip),
18,449
guests, and 6
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: please add hard edges to model improvements II
[Re: ventilator]
#49013
06/03/06 10:42
06/03/06 10:42
|
Joined: Jan 2003
Posts: 4,615 Cambridge
Joey
Expert
|
Expert
Joined: Jan 2003
Posts: 4,615
Cambridge
|
Quote:
provide a threshold angle for smoothing in materials. not as flexible as arbitrary hard edges or smoothing groups but good enough for most cases.
but there has to be some solution for this!
there is, but since i don't know much about shaders, i'm not sure wether it is possible with 3dgs or not. anyway, here's the article:
http://simland.planetquake.gamespy.com/pages/articles/phongshading1.htm
looks as if phong shading has some kind of parameter that you can change (or is it engine-specific?). then the shading will only apply for angles greater than the one you set.
greetings, joey.
|
|
|
Re: please add hard edges to model improvements II
[Re: ventilator]
#49015
06/03/06 21:02
06/03/06 21:02
|
Joined: Oct 2003
Posts: 4,131
Matt_Aufderheide
Expert
|
Expert
Joined: Oct 2003
Posts: 4,131
|
You kbow, i dont think this probem is currenty solvable. The way D3D works precludes smoothing groups or hard edges, unless the vertices are not welded. So basically, its an art thing, not a code or model format thing.
Basically, every shading method uses vertices, not faces, so everything has to be interpolated. Thats why flat shade mode doesnt really work, because it still does shading per-vertex, not per-face.
if you changed the vertex format to include some things, who knows, maybe there is some hack that could work, but frankly ive never seen anything like that. It's a hardware limitation. Maybe with DirectX 10 there will some possiblity.
It could be done in software, but so what, so can anything..
|
|
|
Re: please add hard edges to model improvements II
[Re: Matt_Aufderheide]
#49016
06/03/06 21:36
06/03/06 21:36
|
Joined: May 2002
Posts: 7,441
ventilator
OP
Senior Expert
|
OP
Senior Expert
Joined: May 2002
Posts: 7,441
|
yes, i know that. but the mesh you work with and the data that gets drawn by direct3d shouldn't and doesn't have to be the same. i think internally the engine would need a second data structure with a welded closed mesh for calculating stencil shadows (but the a6 stencil shadows are useless anyway  ) even if some vertices of the mesh that gets drawn are split to achieve hard edges. there has to be some solution for this in 3dgs! most other engines have solutions for this. and the mdl7 format isn't a direct representation of the direct3d mesh. it's an artist format which doesn't only get loaded and displayed by the engine but is also meant to be worked with in med so i don't see a problem with adding some kind of smoothing information to it.
|
|
|
Re: please add hard edges to model improvements II
[Re: ventilator]
#49017
06/04/06 10:39
06/04/06 10:39
|
Joined: Jun 2003
Posts: 1,017 Germany
Thomas_Nitschke
Senior Developer
|
Senior Developer
Joined: Jun 2003
Posts: 1,017
Germany
|
I second that, ventilator. I have to admit I am no expert in d3d or anything but, seeing that MED can do flat shading while, at the same time, using a directX render library, there certainly has to be a solution to do this same effect in the engine. Plus, as ventilator stated, other engines -many other engines- support this as well...
I'd really like to hear a word or two from Conitec on this issue.
Last edited by The Matrix; 06/04/06 10:39.
Formerly known as The Matrix - ICQ 170408644
I've been here for much longer than most people think. So where's my "Expert" status?
|
|
|
Re: please add hard edges to model improvements II
[Re: Thomas_Nitschke]
#49018
06/04/06 11:37
06/04/06 11:37
|
Joined: Aug 2005
Posts: 343 Germany
HPW
Senior Member
|
Senior Member
Joined: Aug 2005
Posts: 343
Germany
|
In the *.X format are smoothing groups available. If this feature of implementing the *.X format to 3GS is released, than I think it's possible to use smoothing groups with 3DGS. The Quest3D Engine (www.quest3d.com) can use smoothing groups from *.X format models.
Evil Blood (v. 0.52) RPG Commport.de (Social Network Community)
|
|
|
Re: please add hard edges to model improvements II
[Re: Matt_Aufderheide]
#49020
06/04/06 15:43
06/04/06 15:43
|
Joined: Feb 2003
Posts: 6,818 Minot, North Dakota, USA
ulillillia
Senior Expert
|
Senior Expert
Joined: Feb 2003
Posts: 6,818
Minot, North Dakota, USA
|
The only method in which this could work is if some sort of light-mapping system was developed specifically for models. Each triangle in MED would get a flag. If the flag is off (default setting), a smooth gradient is used, like that of gouraud shaded mode. If the flag is on, no smoothing is done and is otherwise flat. Smoothing is decent for curved surfaces and flat is decent for flat surfaces that aren't part of a curve. These flags are only used for lightmap calculations for the model. They are ignored in the engine.
"You level up the fastest and easiest if you do things at your own level and no higher or lower" - useful tip
My 2D game - release on Jun 13th; My tutorials
|
|
|
Re: please add hard edges to model improvements II
[Re: ulillillia]
#49021
06/04/06 19:43
06/04/06 19:43
|
Joined: Jun 2003
Posts: 1,017 Germany
Thomas_Nitschke
Senior Developer
|
Senior Developer
Joined: Jun 2003
Posts: 1,017
Germany
|
I'd still be interested how in heavens MED can do it -with DX, it seems- whereas the engine can't? That doesn't really make sense to me 
Formerly known as The Matrix - ICQ 170408644
I've been here for much longer than most people think. So where's my "Expert" status?
|
|
|
Re: please add hard edges to model improvements II
[Re: Matt_Aufderheide]
#49022
06/04/06 23:02
06/04/06 23:02
|
Joined: May 2002
Posts: 7,441
ventilator
OP
Senior Expert
|
OP
Senior Expert
Joined: May 2002
Posts: 7,441
|
Quote:
I dont see any way on a API/hardware level that you can have a feature like this. Vertices are either welded in a mesh or not, and I dont believe any modern 3D engine has this kind of feature. With vertex and pixel shaders there is no way to get information from other vertices or to turn off interpolation..
in my opinion the mdl7 format should contain some kind of smoothing information and when the engine loads it it generates the direct3d mesh with taking the smoothing information into account (it splits vertices where necessary). for calculating stencil shadows (and i think other things like some collision detection algorithms work better with closed continuous meshes too) the closed mesh data like in the mdl7 file has to be used.
i don't know the details of how other engines do this but for example with ogre3d it's no problem to have hard edges in models and use stencil shadows with them.
and having split vertices in a model format which isn't only meant for being loaded by an engine but also for editing in a model editor is a kind of ugly solution.
|
|
|
|