Jump to content
The Dark Mod Forums

Neat Vertex Normal Trick


rich_is_bored

Recommended Posts

I was trying to find reference information on the ASE format while doing some bug fixing when I stumbled upon this...

 

http://wiki.polycount.com/VertexNormal

 

We struggled at D3W trying to figure out how to make foliage that didn't look like crap for years and the solution seems relatively simple. I wish I had more time to try my hand at this. I'm sure it would work.

 

Maybe next year. :)

  • Like 2
Link to comment
Share on other sites

I hate to keep leaving hints everywhere but if any of you Modelers out there grasp this article (actually doesn't look too difficult...) then Tels may have a use for it ;)

Edited by nbohr1more

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Link to comment
Share on other sites

Yeah, I think the only thing that differs from your suggestion is that the Normal Maps in rich_is_bored's method are tuned by hand (or by a higher-poly model) thus adding more subtle lighting tricks to the leaf clumps.

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Link to comment
Share on other sites

I'm trying it, the 'faster' script locked up my comp, blue screen thing. Didn't see what version it's for but obviuosly newer than 7.

 

The 'old' one seems to lock up after only a few normals. I may be able to spilt the mesh up some and wrok in pieces, we'll see if Max comes back...

-----------

 

Ah it finished back with screens...

Dark is the sway that mows like a harvest

Link to comment
Share on other sites

Well, this was a cherry blossom tree I had made for TF2. The actual cherry blossoms were alot thicker than these leaves... (just grabbed some quick tdm materials)

 

But still, one of these is normal (all normals pointing straight up) and one is modified normals (normals bent in an arc over top of tree).

 

I can't see ANY difference at all.

 

I am using the 'tri-panes' method shown on that page. Maybe it works better with the 'cross plane' method that we have on alot of the 'dm' trees, I think those a Dram's from Blackheart Manor. They are .ase and I'd have to roll back to some old version of Max to be able to import them.

 

 

rich_is_bored, wanna write a Max7 .ase import? :D

post-1981-128007429034_thumb.jpg

Dark is the sway that mows like a harvest

Link to comment
Share on other sites

I bookmarked this page, this is certainly an interesting idea ;)

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

I bookmarked that site! Looks like just the site I was looking for only yesterday; something to maybe help me clear up all this random/variablysourced/overlapping/double-meaning/vaguelydefined terminology, so I don't have to keep bugging every time I try and get a grasp on 3D tech.

 

So thanks for that at least.

 

It sure looks like an improvement in on the demo page, but Badcogs, as he says, shows no difference. But that tree isn't especially "bushy" anyway; it looks cool already.

"A Rhapsody Of Feigned And Ill-Invented Nonsense" - Thomas Aikenhead, On Theology, ca. 1696

Link to comment
Share on other sites

I don't see a difference between those trees but I started a similar topic on D3W and I can see a difference in the crate example posted there...

 

http://www.doom3world.org/phpbb2/viewtopic.php?f=26&t=23781&view=unread#unread

 

I'm going to try something really simple later just to verify if this works for certain or not. I'll keep you posted.

  • Like 1
Link to comment
Share on other sites

Okay. I've hacked together a simple plane with the normals bent and I've applied a slightly modified version of a foliage decal texture. Here's a comparison image where the top half is stock and the bottom has bent normals...

 

post-1779-128013670635_thumb.jpg

 

The bent normal version appears to have a bit more volume and definition. The stock version is almost uniformly lit while the bent normal version has highlights and the falloff is much better.

 

Let's turn the lights down...

 

post-1779-128013671524_thumb.jpg

 

The same is true here only it's a bit more evident how drastic the falloff is.

 

One issue I noticed is that double sided textures will not work with this technique because the normals are inverted on the opposite side. This means when a light is at the bottom, the top gets illuminated and vice versa.

 

The workaround is to create the required back faces in your modeling application. It might seem like this would cause performance issues but Doom 3 also doubles the polygons when you use the doublesided keyword in your material shader.

 

Here is the model if you'd like to see it for yourself...

 

bentplane.ase.txt

 

Keep in mind the applied texture is double sided so only one side will look correct.

  • Like 1
Link to comment
Share on other sites

I actually think the non-bent ones look better. Maybe the normals are too bent.

 

And the crate... Well, it kindof looks like a balloon IMO. The original has a nice sheen right on the corner like you'd expect. The bent normal looks overly lit/bulbous.

Dark is the sway that mows like a harvest

Link to comment
Share on other sites

The workaround is to create the required back faces in your modeling application. It might seem like this would cause performance issues but Doom 3 also doubles the polygons when you use the doublesided keyword in your material shader.

 

Yeah, D3 does this after loading the modelby creating a second surface with the inverted triangles. You can prevent this by doubling the polygons yourself and just set the material to "onsided" (e.g. skip the "twosided" keyword). You end up with the same number of polygons.

 

Btw, is there an easy description on how you need to edit the normals? Is it just random, or "drawn by the artist" or does it follow a pattern? Because if you can describe the algorithm, we can easily bend the normals after model-load, so that we wouldn't need to modify any of our assets at all.

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

The normals would be bent by preference but the "Normal Thief" program uses a higher poly model to bend the normals algorithmically. I presume you could do a shortcut simply using a Normal Map generated from a High-Poly version of the Tree (etc)...

 

AFAIK the only difference between this and regular Normal Mapping is that you are treating a "cloud" of polygons as if it were a solid object. And the amount of Normal data is significantly lower than a 1 to 1 Normal Mapped texture.

Edited by nbohr1more

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Link to comment
Share on other sites

Yeah, D3 does this after loading the modelby creating a second surface with the inverted triangles. You can prevent this by doubling the polygons yourself and just set the material to "onsided" (e.g. skip the "twosided" keyword). You end up with the same number of polygons.

 

Btw, is there an easy description on how you need to edit the normals? Is it just random, or "drawn by the artist" or does it follow a pattern? Because if you can describe the algorithm, we can easily bend the normals after model-load, so that we wouldn't need to modify any of our assets at all.

 

Don't know if it would really be possible, like nbohr1more said, it's based on a higher poly model. So you'd have to reference a specific model or shape. And on things like Dram's trees you don't want to change the normals on the trunks, just on the flat/plane leafs. So do you ref a sphere model for only the leaf texture? And will it be centered on the leaves? If it's below (centered on tree) then you don't get the correct normal directions.

 

With my trees I tried both a half sphere (because the top of the tree is basically a half sphere) and I tried just using a box with one smooth group shaped to fit the tree top.

 

They both 'worked'. The normals pointed straight up before I started and end up pointing out in a sperical shape when I was done, both very similar.

But I think they didn't change much becuase I used the 'tri-plane' technique and the leaf tex is already on a shaped plane (not flat), so even though the normals all pointed in one direction there is still shading across the arc.

(Honestly we shouldn't be adding any more flat plane trees to the Mod Anyway, or grass or vines, etc...)

And most of the time I've used vines I just slap the tex on a patch and I have a fully customizable vine anyway that gets shaped and bent.

 

(we certianly don't want to do it on crates)

Dark is the sway that mows like a harvest

Link to comment
Share on other sites

A high poly model is not required. What you see in the polycount wiki is a control mesh. But it's overkill.

 

If you can isolate the leaves from the trunk it can be done procedurally. All you have to do is find the center of the cluster and create a vector from that center point to each vertex in the cluster. That vector is then normalized and used as the vertex normal.

  • Like 1
Link to comment
Share on other sites

A high poly model is not required. What you see in the polycount wiki is a control mesh. But it's overkill.

 

If you can isolate the leaves from the trunk it can be done procedurally. All you have to do is find the center of the cluster and create a vector from that center point to each vertex in the cluster. That vector is then normalized and used as the vertex normal.

 

Yeah, I guess that sounds simple enough ;)

 

In that case I guess it wouldn't even matter if the trunk counted for the center of the mesh. It would change the angle of the leaf normals a bit, I think the big thing is just ONLY changing the leaf normals.

Dark is the sway that mows like a harvest

Link to comment
Share on other sites

Sorry if this is a foolish question but...

 

"Would it be possible to create a sculpting tool for Vertex Normals in Dark Radiant?"

 

I suspect it would work like:

 

1) Load the selected textures into a temporary memory space

2) Sculpt the normals

3) Bake the results to new textures

 

:huh:

Edited by nbohr1more

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Link to comment
Share on other sites

It would be texture data no? (Normal Map?)

 

I see the confusion here. I'm referring to editing normals for the textures on Brush Work rather than a Model...

Edited by nbohr1more

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Link to comment
Share on other sites

It would be texture data no? (Normal Map?)

 

I see the confusion here. I'm referring to editing normals for the textures on Brush Work rather than a Model...

 

you can export the brush work to blender as an ase or obj (no patches for obj), then use blender or xnormal to bake a normal map.

But then you need to make a mtr file with that normal map/the diffuse map....

Dark is the sway that mows like a harvest

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

    • nbohr1more

      The FAQ wiki is almost a proper FAQ now. Probably need to spin-off a bunch of the "remedies" for playing older TDM versions into their own article.
      · 1 reply
    • nbohr1more

      Was checking out old translation packs and decided to fire up TDM 1.07. Rightful Property with sub-20 FPS areas yay! ( same areas run at 180FPS with cranked eye candy on 2.12 )
      · 3 replies
    • taffernicus

      i am so euphoric to see new FMs keep coming out and I am keen to try it out in my leisure time, then suddenly my PC is spouting a couple of S.M.A.R.T errors...
      tbf i cannot afford myself to miss my network emulator image file&progress, important ebooks, hyper-v checkpoint & hyper-v export and the precious thief & TDM gamesaves. Don't fall yourself into & lay your hands on crappy SSD
       
      · 7 replies
    • OrbWeaver

      Does anyone actually use the Normalise button in the Surface inspector? Even after looking at the code I'm not quite sure what it's for.
      · 7 replies
    • Ansome

      Turns out my 15th anniversary mission idea has already been done once or twice before! I've been beaten to the punch once again, but I suppose that's to be expected when there's over 170 FMs out there, eh? I'm not complaining though, I love learning new tricks and taking inspiration from past FMs. Best of luck on your own fan missions!
      · 4 replies
×
×
  • Create New...