Jump to content
The Dark Mod Forums

Dragofer's Stuff


Dragofer

Recommended Posts

Regarding the material files posted, in one you wrote noselfshadow and in the other noselfshadows. Maybe the latter is wrong and causing the issues with the material not smoothing.

FM's: Builder Roads, Old Habits, Old Habits Rebuild

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Link to comment
Share on other sites

Regarding the material files posted, in one you wrote noselfshadow and in the other noselfshadows. Maybe the latter is wrong and causing the issues with the material not smoothing.

 

Thanks for pointing this out, but there is an explanation for the typo - I had replaced the original noselfshadows line with noshadows, and then for this post typed the noselfshadow(s) back in again to show the original material shader. It's an oversight, sorry.

 

About the smoothing issues, I'd like to try to use an earlier version of Blender with the .lwo exporter, and if that doesn't work just use .ase. The earlier Blender version might come in handy there too if the .ase exporters don't get updated very often.

 

The way it is now, the exporter doesn't function properly if it makes .lwo files that can't be opened in Lightwave.

 

 

 

 

I used the plugins for Modo made by past id's artist, Seneca, he made them to export models from modo for Doom 3, so perhaps that is why it all worked smoothly. ;D

 

I can always appreciate a pun ;)

Edited by Dragofer
  • Like 1
Link to comment
Share on other sites

  • 3 weeks later...
About the smoothing issues, I'd like to try to use an earlier version of Blender with the .lwo exporter, and if that doesn't work just use .ase. The earlier Blender version might come in handy there too if the .ase exporters don't get updated very often.

 

 

Any luck with this? Those light models are excellent and I'd love to add them to the mod.

Link to comment
Share on other sites

Any luck with this? Those light models are excellent and I'd love to add them to the mod.

 

Yes, going back to Blender 2.70a did the trick for making smoothed .lwo models (current Version is 2.74). The interface looks identical to that of the newest version so it's simple to just use 2.70a from now on. Springheel, I've made a test torus here - could you try and see if it opens normally in Lightwave please?

 

 

 

 

The remaining problem is that my existing models made in Blender 2.74 still won't smooth when exported via 2.70a. Now I'm trying to find a way to turn a 2.74 file into a 2.70a file. If it doesn't work, recreating those lamps from scratch is no problem, but I have another carriage model that would be a lot of work to remake. In a pinch I could just make new renderbump versions of materials, but hopefully there's a cleaner solution.

 

 

 

D5rIByQ.png?1

 

Technical issues aside, I'm wondering how to move on from here. My overview of what's next is this:

- UV: The body panels are unwrapped and arranged to use the space on a 1024x1024 UV map, so they can be painted in GIMP. I don't have a source image that could just be pasted on, so to get trims and details I'd need to draw basic lines or find opensource pictures on the net and photoshop them.

- Texture normalmap: as I understand this all it takes to get this is to run the model texture through an automatic GIMP plugin.

- Hi-poly to Low-poly normalmap: I could model on trims and details to become part of the model's normalmap.

- Collision model: this looks too big to become a "moveable" with physics (in the sense of an apple or a ragdoll). So I can simply give it multiple collision meshes.

- Shadowmesh: just use _ns materials and make new meshes with shadow or shadow2 textures where appropriate.

 

Tris: it's at 9800 at the moment. Seats: 640 tris, lamps: 546 tris each, wheels: 480 tris each, wooden bodywork: 900 tris, leather hood: 940 tris, metal&wooden bars: ~4000 tris

 

 

 

  • Like 4
Link to comment
Share on other sites

Thats an excellent carriage model...

A few notes on your list:

 

UVs - If I understood correctly, putting the whole carriage inside a 1024 texture might be too little, you should consider having the model made of different meshes with their own independent texture.

 

Normal map - indeed, there are a few plugins or even software that convert images into normal maps. Most of the times, its quite sufficient. What wont work however is when you have a diffuse image with projected shadows that are too visible, because those shadowed volumes will be translated into recessed areas and they will look wrong. Sometimes it pays to edit the images manually before converting. See this article: http://www.katsbits.com/tutorials/textures/how-not-to-make-normal-maps-from-photos-or-images.php

 

Highpoly - Usually, you only use this feature when you actually start the model from a highpoly version, sculpting it somewehre. You then use the highpoly as a base for topology where you create the low poly version (or by decimating), and it also serves as a your normal map source. If you start with a low poly model, you could also use it as a base for making a highpoly version for normal mapping purposes, but that seems overkill, and not needed in this case IMO, since its a "scenery" item and not something the player will be using up close, which would justify the extra work. Most of the little details like bolts and stuff could simply be drawn on the texturing phase.

 

Collision - Definitely not a "moveable", unless you plan on having it fall from a cliff or something? Im not sure if a collision model is needed.

 

Shadow - Exactly, you can probably even ignore most of those linear decorative or structural elements and concentrate on remaking the main body of the carriage as simpler geometries textured with the shadow material. I would probably keep the wheels as they are, but ignore the rest of the metal work and see how it looks, chances are players wont miss those shadows at all.

 

Very good work.

Edited by RPGista
  • Like 1
Link to comment
Share on other sites

could you try and see if it opens normally in Lightwave please?

 

 

Unfortunately it doesn't. Maybe my version of LW is too old? I don't know.

Link to comment
Share on other sites

  • 2 months later...
  • 2 weeks later...

Just wondering if the smoothing issue with the gas lights ever got resolved?

 

If so, was a light entity prefab created for them?

 

The setup of reverting to a slightly older version of Blender (2.70) and using exporters made with TDM in mind was promising because it produced properly smoothed test objects like a metal sphere and torus. But when I made a new copy of one of those lamps from scratch in Blender 2.70 it had the same smoothing problem again: metal is flat, glass is smoothed. There must be a problem with how I've set up the lamp at some point while modelling it.

 

On a sidenote, I've seen now that even the old setup in Blender 2.74 is capable of making properly smoothed test objects, so it's unclear whether reverting to 2.70 was needed.

 

 

I'd very much appreciate if someone else who uses Blender tried to export what I have. This package has both the original and the remade .blend files, the .lwo exporter that I use (also .ase) and an already exported .lwo model:

https://www.dropbox.com/s/ugb26n73t1kjuxl/spherelamp.rar?dl=0

Edited by Dragofer
Link to comment
Share on other sites

I'm no modeller but Xcen wrote-up an excellent guide on using Blender to fix normals for LWO models.

Maybe this would help:

 

http://wiki.thedarkmod.com/index.php?title=Modeling_-_Basic_Tutorial#Using_Blender_to_Fix_LWO_Vertex_Normals

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

The problem with my guide was that I used Blender 2.75a which isn't fully compatible with the exporter.

You can't export the shadow and collision meshes with it.

Here is a revised version:

I switched back to Blender 2.70a and the steps to add a shadow and collision mesh start at 28 and end with step 39.

1. I use Blender 2.70a with default settings. Nothing changed. Like a clean install. I started from your first uploaded .lwo model.
2. Start Blender.
3. In the top left click on "File" and go to "User_Preferences"
4. Go to "Add-ons" -> "Import-Export" -> and activate "Import-Export: Import LightWave Objects"
5. Download this exporter: http://www.blenderartists.org/forum/showthread.php?336749-The-LWO-import-export-project
6. In the "User-Preferences" -> "Add-ons" go to "Install from File...", install the exporter and make sure it is activated.
7. In the top right is a window named "Outliner" where you can see a "Camera", "Cube" and "Lamp" entity.
8. Right-click on the names ("Camera", "Cube" and "Lamp") and delete them.
9. Go to "File" -> "Import" -> "LightWave Object (.lwo)" and load your model.
10. In the top right "Outliner" window left-click on your model. Now you should see an orange outline on your model. If not press key 'a' to select your model.
11. Check that you are in "Object Mode". Near the bottom of your window to the right of a "Object" menu you can select a mode (Object, Edit, Sculpt, Vertex, Weight and Texture).
12. On the left side go to "Tools" -> "Edit" -> "Shading" and select "Smooth".
13. Now press key 'tab' or click "Object Mode" near the bottom of your window and change it to "Edit Mode". When changing to edit mode you can see every triangle/quad hightlighted in orange. If not hit 'a'
14. Press 'a' to deselect your model.
15. Near the bottom of your window check a box (a cube with an orange line) named "Edge select".
16. If you right-click on an edge you can select it. Press and hold 'shift' while you right-click and select some edges that you want to split.
17. With the edges selected press 'ctrl' and 'e' to open the "Edges" menu and select "Mark Sharp". Now you should see a cyan line (and some orange sparkling through). If you want to unmark an edge go to "Edges" -> "Clear Sharp".
18. Change back to "Object Mode" with 'tab' and then press 'a' to deselect your model.
19. On the right side below the "Outliner" is the "Properties" window. Sometimes you need to rescale the window to make all entities visible. Just left-click on the border and drag.
20. Select the wrench icon to open the "Modifiers". Go to "Add Modifier" and select "Edge Split" in the second column.
21. Uncheck "Edge Angle" and make sure "Sharp Edges" is activated. Don't hit "Apply" yet.
22. Now the previously marked edges look sharp. But the modifier isn't applied yet. You only see what you will get when you apply the "Edge Split" modifier.
23. Press 'tab' to switch back into "Edit Mode" and select all edges ('shift' + right-click for selection and 'ctrl'+'e' -> "Mark Sharp" to mark for splitting)
24. When every edge is marked for splitting go back into object mode (press 'tab') and hit "Apply" in "Properties" -> "Modifiers" -> "Edge Split". Make sure only "Sharp Edges" is checked.
25. If your model isn't triangulated go to "Edit Mode" (hit 'tab'), select everything (hit 'a') and press 'ctrl'+'f' to go to the "Faces" menu and select "Triangulate Faces".
26. To change the name of the material go to "Properties" on the right side and go to "Materials".
27. Below the list on the top is a field where you can enter or edit the name. Change it to the name of your material in the ".mtr" and hit 'enter'. Now you should see the new name in the list on the top.

28. To add a shadow and collision mesh to your model hit 'a' to deselect everything and 'tab' if you are not in "Object Mode" or select it on the bottom of your "3D View" window.
29. When in "Object Mode" press 'shift'+'a' to open the "Add" menu go to "Mesh" and select a mesh type to use as a shadow mesh.
30. Now there is a second object in the "Outliner" window on the top right.
31. Smoothing, edge splitting or a proper and clean uv map aren't necessary for shadow and collision meshes.
32. If you are still in "Object Mode" hit 'tab' to switch to "Edit Mode" and select the "Shading / UVs" on the far left. Go to "UVs" and select "Unwrap" and "Unwrap". Alternatively you can hit 'u' to enter the "UV Mapping" menu and select 'Unwrap'.
33. To see your uv map go to the bottom left of your "3D View" window and drag the window to the right. Now you get a second "3D View" window to the left of your "3D View".
34. Click on the cube symbol on the bottom left of your new window and switch to to "UV/Image Editor" mode.
35. Now you can see your uv map. If not hit 'tab' and switch to "Edit Mode" and 'a' to select everything.

36. To add a material go to "Properties" on the right and go to "Materials" and "New".

37. Change the name of the material to something from the "tdm_textures_base01\materials\tdm_collision.mtr" for the collision mesh. For a shadow mesh use "textures/common/shadow" or "textures/common/shadow2".

38. Shadow and collision meshes need to be triangulated too. Go to "Edit Mode" ('tab') press 'ctrl'+'f' to open the "Faces" menu and select "Triangulate Faces".

 

39. If you have more then one object you need to export them to one layer. To do this switch to "Object Mode" ('tab') and select the objects in the "Outliner" window (top right) with 'shift'+'LMB'. To merge them 'ctrl'+'j'. Click on the plus symbol on the left of your objects name in the "Outliner" window and again on the next plus. Now there should be the name of your texture, collision and shadow materials.

40. For export make sure you are in "Object Mode" (hit 'tab').
41. Go to "File" -> "Export" -> "Lightwave (.lwo)".
42. On the bottom left there is a "LwoExport" window.
43. Check "Smoothed". Actiavate "idTech compatible". And uncheck "Recalculate Normals". If there is something inverted ingame make sure to uncheck this one.
44. "LwoExport" in the top right.

Edited by Xcen
  • Like 2
Link to comment
Share on other sites

The problem with my guide was that I used Blender 2.75a which isn't fully compatible with the exporter.

 

You can't export the shadow and collision meshes with it.

I'm using Blender 2.75a and it works. In order to export models with multiple materials try joining all the objects (ctrl+j) before export. Make sure you have:

noshadows
noselfshadow

in your proper material so that only mesh with shadow material will cast shadows.

It's only a model...

Link to comment
Share on other sites

Here is a revised version:

 

Great, this worked exactly as it should. Thanks for posting this here Xcen.

 

Now to setup the new custom light entities. The wiki as far as I can find doesn't seem to have something about setting up new lamp entities, but the existing lamp definitions describe the spawnargs well already.

Edited by Dragofer
Link to comment
Share on other sites

Next up

The stagecoach in model format. Using the stagecoach is more straightforward and no longer increases the map’s number of patches by close to 1000, which would be noticeable in loading and dmap times. It also allows for skins.

 

Download:

[bsolete]

 

What’s in this package:

•Models: complete stagecoach with or without interior, also front and rear wheel models, left & right door models, and a version each of those stagecoaches without wheels attached (i.e. if the stagecoach lost a wheel)

•Skins: seats in 4 colours or leather for the stagecoach with interior. Windows as default unlit or colorme for the stagecoach without interior in case the default windows should be darker.

•Prefabs: stagecoach with or without interior, setup with doors or windows as I’d have intended them. Also 2 unlit candles inside the lanterns.

•Materials: noshadows versions of dark_rough, beam_rusty_victorian and the 4 armchair skins. I’ve put the first 2 where the other model textures are to avoid adding clutter to the wood and metal textures menus.

 

You'll find them at:

Create model -> darkmod -> misc -> carriages

 

 

HyLaHkb.png

 

 

More technical details:

 

- The stagecoaches use a mixture of noshadows materials and shadow meshes. The interior stagecoach has just above 4000 shadowcasting polys, the one without has 2000 shadowcasting polys.

- The prefabs can be rotated.

- Here’s the source file (I’ve also updated my previous sphere lamps post for this): Dropbox

 

 

Edited by Dragofer
  • Like 4
Link to comment
Share on other sites

So... I put into a test map and I spotted the following -

  • rains (or what ever the connections from the coach to the horses are called) for the horses
  • interior lights.
  • and the seat is 8 units to high for Ai (coachman) to sit down.
  • I see you have used a mixture of non-shadows and shadow casting wood through-out, it would be simpler to use non-shadow through-out and then make make a low-poly shadowmesh for each of the models.
  • all the hidden faces on all of the models should be caulk/nodraw, as this cuts down on the tris-count in-game.
  • imho, the glass on the outside lights should be clear.

Overall very impressive though :-)

 

https://www.youtube.com/watch?v=ogCPNA_7z4A&

Link to comment
Share on other sites

all the hidden faces on all of the models should be caulk/nodraw, as this cuts down on the tris-count in-game.

 

 

 

There is zero point in adding caulk or nodraw textures to models...if the tris aren't important, just delete them (although there's not much point in that unless we're talking hundreds of polys in savings).

Link to comment
Share on other sites

Also moving forward this is a habit all mappers & modelers should get into doing.

 

 

We've already established that it doesn't have any effect while mapping. From the wiki:

 

Every now and then, caulking rises up debates, whether or not it is useful or not. The basic question is, whether or not it is beneficial to spend a lot of time caulking and how much caulk is required to get a solid impact on fps rate. Recent tests performed by Sotha (Link) gave the following results.

Caulking a medium complex scene with tens of windows and other objects (Knighton Manor start) did NOT have any effect on fps counts. Caulking did save roughly 1000 tris, but this is not sufficient to cause any fps improvement. The main benefit of caulking was the decrease of memory usage: 1000 saved tris saved 0.6MB of memory.

Testing indicated that on a rather high-end computer increase of 23000 tris, 75 draws and 2500 shdw reduced the fps count by two. If a window consists of 5 brushes and the wall facing surfaces are caulked, this saves 5 surfaces and thus 10 tris per window. This would mean that 2300 windows should be caulked to get an improvement of 2fps. Basically this shows that caulking does not have much impact on modern hardware. However, on an older piece of hardware the amount of caulking needed for performance effect is lower, but even in this case it should be remembered that 1000 tris is roughly 20% of a single AI character.

 

 

The same basic rules would apply for modelling. If you have an extra 100 polys that you don't need on a model like the stagecoach, it's not going to matter in the slightest, unless you plan to have at least 10 of them in the same scene. Sure, in general, it's more neat and tidy to get rid of the extra polys, but that takes time and energy that could be spent elsewhere. I'd much rather have 3 good models with a few extra polys than 2 good models that are perfectly optimized.

 

Shadow meshes are FAR more significant when it comes to increased performance, and I'd rather mappers put their energy there.

Link to comment
Share on other sites

Great, I appreciate that you looked so closely at it. I also do like that testmap, much more going on there than in mine.

 

[*]reins for the horses

 

If attaching AI horses to the stagecoach, I'm not sure what to do if the player shoos away the horses - maybe the reins should fall off? Things would be much easier if all players always played by the rules.

 

[*]interior lights.

 

Yes that would be good to have by default, especially considering your testmap was fine with lights all over the coach - I'm guessing you made them noshadows, small radius and bright_square (the light texture with less dropoff)

 

[*]the seat is 8 units to high for Ai (coachman) to sit down.

 

I like how you've put someone up there :P What will he do if he ever wants to get down?

 

[*]imho, the glass on the outside lights should be clear.

 

Do you mean clearer, less opaque? At the moment they share a transparent glass texture with the chassis windows.

It should work to allow AIs to enter and sit inside the stagecoach. Imagine seeing the lord arriving and stepping out of his stagecoach to take up affairs at his estate. Or spotting a noble from afar through the window of his stagecoach, travelling through the streets of the city. Kind of like a crow.

 

The elevator system could be a place to look for a way to transport AIs. The stagecoach would stop - if it stops - inside fitting monsterclip brushes. Then the map would have to prevent that the player alerts/shoots an arrow/gets in the way, physically or with objectives.

Edited by Dragofer
Link to comment
Share on other sites

Regarding optimising, I used standard textures for parts which were already simple enough to be a shadowmesh, and for parts where it would've been difficult to make a shadowmesh that uses significantly fewer tris.

 

Examples are the undercarriage beams and the curved body panels of the stagecoach with an interior. The closed stagecoach on the other hand allowed for a very simple shadowmesh, so most of the shadow tris there are from the wheels.

 

I've mostly used patches to make the coach so there was less potential for hidden faces than with brushes. If a patch beam is on top of something else I used SteveL's patch splitter to get rid of the hidden side. When converting the stagecoach to a closed version I deleted any faces that could only be seen from inside - much easier with the patch splitter. I did spend some time caulking unseen faces in the sidelanterns because they're made mostly of brushes - very fiddly and could've been avoided by making those out of patches too.

 

That's what I've done, though I'm always interested to hear of other ways to approach optimising.

Edited by Dragofer
Link to comment
Share on other sites

Why would there be interior lights? Is that common in old coaches? It seems like the kind of thing mappers could add themselves if they wanted.

Link to comment
Share on other sites

Exterior lights are quite common. I've browsed through a lot of images and haven't seen any kind of interior lights. What would they look like?

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...