Jump to content
The Dark Mod Forums

Request - Lower poly hedges


ddaazzaa

Recommended Posts

Just wondering if anyone is able to create some lower/mid range poly models of the hedges that are included as part of the core assets? Currently the hedges have hi and low poly versions. The low poly versions are very basic and range between 50-100 polys. The hi poly models are mostly 2500 and 5000 polys with one even being 9600. When using hedges in maps, most times they will be used in rows or columns, this means poly count can start to skyrocket if too many of them are used.  I found this out with my map Blackgrove Manor.

With the hedge models being smaller in size, it also means there are many unnecessary polys being wasted on the interconnecting sides. Creating some longer and/or taller hedges would help alleviate those unnecessary polys.

If anyone is able to help out with this, it would be greatly appreciated.

Thanks.

hedge.jpg

  • Like 1
Link to comment
Share on other sites

45 minutes ago, HMart said:

IMO use TDM LOD (level of detail) system, meaning at far distance the HD models will change to the low poly ones no need to make new models. 

This doesn't solve the issue of when moving closer, the full poly models will be displayed and performance will still be affected

1 minute ago, Frost_Salamander said:

Would just scaling them with the model scaler in DR help with the long/tall versions? https://wiki.thedarkmod.com/index.php?title=Model_Scaling

I have been experimenting with the model scaler and I might be able to use that to an extent as a workaround. Although it doesn't help with other mappers using the hedges in future as they will all have to do the same.

Link to comment
Share on other sites

I guess the problem is that high-poly model has a lot of leaves on it, making it look 3D.
The lower-poly looks flat... does it have any leaves at all?

I wonder if something in the middle is possible: not too much triangles, but visible 3D geometry.

Link to comment
Share on other sites

2 hours ago, ddaazzaa said:

This doesn't solve the issue of when moving closer, the full poly models will be displayed and performance will still be affected

I have been experimenting with the model scaler and I might be able to use that to an extent as a workaround. Although it doesn't help with other mappers using the hedges in future as they will all have to do the same.

Yes that is true but if you make it only show the HD model relatively close to the player than the number of HD models visible at a time, will be low, so it should help.

About scaling down the model, I hope you know that it will have zero affect on the triangle count? But thinking about it, it does make the model take less screen space and so, few pixels needed to render it and it also increases the probability it will not be lighted by many lights at the same time, so perhaps there's something to that trick but I don't believe the performance gains will be comparable to LOD's, imo is still the best option, with the benefit that at close range the player will see a HD model, instead of always the same model at all distances. 

 

Link to comment
Share on other sites

The Real WTF is that a model which looks barely any different from a slightly misshapen brush manages to waste 9600 polygons. I can only assume it was generated with some procedural method which produces a very high number of randomised internal polygons which in all likelihood you cannot actually see from the outside.

Out of curiosity I started updating the LWO import script for Blender. Currently it imports edges and faces but is not yet handling materials and UVs, so it's a long way from "round trip safe" in terms of loading and editing existing models.

  • Like 1
Link to comment
Share on other sites

On 5/11/2021 at 3:44 PM, HMart said:

About scaling down the model, I hope you know that it will have zero affect on the triangle count? But thinking about it, it does make the model take less screen space and so, few pixels needed to render it and it also increases the probability it will not be lighted by many lights at the same time, so perhaps there's something to that trick but I don't believe the performance gains will be comparable to LOD's, imo is still the best option, with the benefit that at close range the player will see a HD model, instead of always the same model at all distances. 

 

I think all he's saying is instead of taking 5 small hedges (each with say 9000 polys) and lining them up side by side, you just take one and stretch it out.  But does scaling it like this increase the polys, or just stretch them?  I don't know what it would look like either?

Edited by Frost_Salamander
Link to comment
Share on other sites

1 hour ago, Frost_Salamander said:

I think all he's saying is instead of taking 5 small hedges (each with say 9000 polys) and lining them up side by side, you just take one and stretch it out.  But does scaling it like this increase the polys, or just stretch them?  I don't know what it would look like either?

 

35 minutes ago, OrbWeaver said:

Scaling only increases the size of existing faces, it does not create any new ones. But because the texture will be scaled along with the model, the hedge leaves will probably look huge.

 

non uniform scaling will most probably deform the model to much and make it look bad, but no harm in trying.

About the texturing, the same has the model, it will stretch the texture and imo make it look bad. 

DR has a nice feature in that it can unlock/decouple the textures, from surfaces, by disabling "Texture Lock" the lock icon at the top icon menu UI, this makes it so you can move and scale surfaces and the texture will stay put but unless I'm missing something this only works for brush surfaces, not models imported from a outside tool or even made on DR and converted to ASE or LWO, for those, you need to open the model in Blender for example and resolve the UV stretching there.

Edited by HMart
Link to comment
Share on other sites

I noticed something weird when using my WIP import script to load the hedge models: there are loads of duplicate faces (the same three vertices are used to generate a face more than once). This resulted in about 2400 extra polygons for one of the models. However I need to do more investigation to work out if this is a problem with the model or just a bug in the script — perhaps duplicate faces are how the LWO model represents twosided faces which can be viewed from both directions.

Link to comment
Share on other sites

What model it is? I can inspect it in Modo if you want. 

Btw is not only two sided faces that duplicate vertices, for smooth shading, using hard and soft edges and if I'm not mistaken, smoothing groups like in 3DS Max, literally cut the model at the edges marked has hard at export time, so duplicating and overlapping vertices. 

Link to comment
Share on other sites

I think it's a problem with the current incarnation of the script. These are some faces created out of vertex IDs in model hedge01_square_long.lwo:

Face: [5288, 5286, 5289]
Face: [5287, 5286, 5288]
Face: [5288, 5289, 5286]
Face: [5287, 5288, 5286]

So although it's using the same three vertices to create two faces, the vertices are specified in a different order which is clearly intended to create two-sided faces. The problem is that when I try to create such faces in Blender it throws an exception (Face already exists), and does not seem to care about the vertex ordering. I'll need to research what is the correct way to handle this in Blender, perhaps there is a two-sided property that can be set on the face rather than trying to create it a second time.

Link to comment
Share on other sites

So it turns out Blender has no concept of a "two sided face", but during rendering it assumes everything is two-sided by default unless the "Backface Culling" option is set in the Material properties. It seems therefore that the only way to handle these duplicated faces during import is to discard them, and if the user really wanted to export with duplicated geometry in this way, an option would be needed in the export script.

However, I think that there is actually no need for such duplicated faces in the LWO files, because (like Blender) "twosided" is a property of the material shader, not the geometry. Provided the hedge materials contain the twosided material keyword where necessary, the models could be exported without duplicate faces and this might give some performance benefit.

  • Like 1
Link to comment
Share on other sites

I most say ddaazzaa is right, I add a look at that model in modo and it is full of two sided planes, making up 5128 polys just for the planes alone.

Like OrbWeaver said this model doesn't need two sided planes, one side ones, looking in different directions, imo will be good enough to keep the intended illusion and bring the poly count down plus increase the possibility of using more models per level like ddaazzaa wanted.

attached as demonstration is the "cleaned" model itself (2660 polys) and a very basic Modo render, sorry for the quality but I think it passes the message across.  Is not exactly the same but I bet if you increase the leaf count in the plane texture itself, it will look exactly like the double side one.

hedge_demo.jpg

hedge01_square_long.lwo

Edited by HMart
Link to comment
Share on other sites

Btw now that TDM supports GLSL shaders, perhaps someone, someday, could make a "Fur" shader that can also be used for this effect. :) 

 

 

And even thou it creates way more planes, I think it will be faster because they are created directly by the GPU itself. 

Link to comment
Share on other sites

2 hours ago, HMart said:

I most say ddaazzaa is right, I add a look at that model in modo and it is full of two sided planes, making up 5128 polys just for the planes alone.

Like OrbWeaver said this model doesn't need two sided planes, one side ones, looking in different directions, imo will be good enough to keep the intended illusion and bring the poly count down plus increase the possibility of using more models per level like ddaazzaa wanted.

attached as demonstration is the "cleaned" model itself (2660 polys) and a very basic Modo render, sorry for the quality but I think it passes the message across.  Is not exactly the same but I bet if you increase the leaf count in the plane texture itself, it will look exactly like the double side one.

 

hedge01_square_long.lwo 167.32 kB · 0 downloads

 

Double-sided textures do not cast shadows, IIRC, so changing the model in that way will mean only the square in the center would cast an--obviously incorrect--shadow.  While that would be fine for a medium LOD stage, it shouldn't replace the original.

You might also make a decent medium LOD version by just turning shadows off on the leaf planes at a certain distance.  Poly count by itself is rarely the issue when it comes to performance--it's shadows and the number of lights hitting any one model.

Link to comment
Share on other sites

The small planes overlap enough that the edge of the shadow would look sufficiently leafy.  I can't remember whether or not those shadows are turned on by default though.  It's possible they aren't.

 

 

Link to comment
Share on other sites

If you're running advanced (I think it's maps?) lighting mode, you will actually have alpha tracing on your leaf-alpha cards unless it's disabled in the mtr. Topiary garden bushes are still a good bit of work in any engine, as it's hard to get looking 100% right without a lot of polys thrown at it. The only problem I myself had with this kind of modeling, is I never had a populate/scatter system to automate my leaf cards across the surface. Doing this by hand sucks but your poly count really starts to go up when you're using two sided planes for those tasty, tasty shadows.

If you use decent sized leaf cards, they don't have to be as dense to fake the details. But one thing I'd recommend is to do your shape hull (stupidly simple) do a cage over that (running alpha leaves) and then your individual randomized cards on top of that. The dual cage method, if running a good material, will help soften the hard non-seethrough edges you'd get otherwise. Also, if the texture for the cage has really loose alpha, you could maybe have the two cages running shadows and noshadow the expensive leaf cards. Your dropshadow will capture those see through edges and still breakup your plant silhouette but at much less performance cost.

D0D34FF8DC9F9D9BB2D872BB11CBCD05A793C097

 

Old old proof of concept here (not enough leaf cards either) but it gets away with less because of that dual hull method. With a better alpha texture for the secondary hull it would look even better. I think this one also had baked ground plane occlusion as a blend multiply and then in a separate layer tiled the leaf texture separately for the detail pass. Don't discount baked occlusion on stuff like this either. Just because we have SSAO now, doesn't mean it will create as dramatic of visual effect. The reason I'd do baked AO is to help contrast otherwise, featureless plant shapes. So my method would have two texture resources, a tiling base (with and without alpha) for the two primary hulls and one leaf set for the cards. Best of luck in any case, I'm just tossing my two cents out there! 😊

Modeler galore & co-authors literally everything

 

 

Link to comment
Share on other sites

Playing Silent Hill 2 again, saw a old but intriguing way to do grass and this edge leaf's effect and it reminded me of this thread, SH2 also uses planes but not in the way we see them here, is a simple technique and not very realistic for today standards, so not sure if it will work for a relatively modern game like TDM but it did reminded me of this blog post from Blendo Games and is mostly the same technique but with only one or two planes. 

  • Like 1
Link to comment
Share on other sites

There are already plenty of low-poly hedges mappers can use in areas where that is needed. 

There are also multiple transparent foliage textures mappers could use to create their own "shells" if they want to do so.  You could create a couple Russian-doll-like shells of semi-transparent foliage and drop a few low-poly foliage models in the center to create leaves or branches that stick out.

And there are high-poly hedge models for use where that is appropriate.

 

No one is opposed to new models if someone wants to make some, but there's no point in reshaping a wrench so it becomes better at hammering nails.

 

  • Haha 1
Link to comment
Share on other sites

  • 1 month later...
On 5/19/2021 at 11:14 PM, HMart said:

I most say ddaazzaa is right, I add a look at that model in modo and it is full of two sided planes, making up 5128 polys just for the planes alone.

Like OrbWeaver said this model doesn't need two sided planes, one side ones, looking in different directions, imo will be good enough to keep the intended illusion and bring the poly count down plus increase the possibility of using more models per level like ddaazzaa wanted.

attached as demonstration is the "cleaned" model itself (2660 polys) and a very basic Modo render, sorry for the quality but I think it passes the message across.  Is not exactly the same but I bet if you increase the leaf count in the plane texture itself, it will look exactly like the double side one.

hedge01_square_long.lwo 167.32 kB · 1 download

I finally got around to testing that model and it works well. Thanks.

  • Like 2
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recent Status Updates

    • Petike the Taffer  »  DeTeEff

      I've updated the articles for your FMs and your author category at the wiki. Your newer nickname (DeTeEff) now comes first, and the one in parentheses is your older nickname (Fieldmedic). Just to avoid confusing people who played your FMs years ago and remember your older nickname. I've added a wiki article for your latest FM, Who Watches the Watcher?, as part of my current updating efforts. Unless I overlooked something, you have five different FMs so far.
      · 0 replies
    • Petike the Taffer

      I've finally managed to log in to The Dark Mod Wiki. I'm back in the saddle and before the holidays start in full, I'll be adding a few new FM articles and doing other updates. Written in Stone is already done.
      · 4 replies
    • nbohr1more

      TDM 15th Anniversary Contest is now active! Please declare your participation: https://forums.thedarkmod.com/index.php?/topic/22413-the-dark-mod-15th-anniversary-contest-entry-thread/
       
      · 0 replies
    • JackFarmer

      @TheUnbeholden
      You cannot receive PMs. Could you please be so kind and check your mailbox if it is full (or maybe you switched off the function)?
      · 1 reply
    • OrbWeaver

      I like the new frob highlight but it would nice if it was less "flickery" while moving over objects (especially barred metal doors).
      · 4 replies
×
×
  • Create New...