Jump to content
The Dark Mod Forums

Feature Discussion: Material Editor


Recommended Posts

While the pre-release testing of the upcoming DR 2.11 is finishing, I'd like to discuss a possible Material Editor feature. Just to get a picture of whether you guys think this is worth the effort, what it should be able to do at a bare minimum, what the UI could look like, etc.

I know this request has been brought forward at least twice in the past, so maybe this feature is worth pursuing.

  • Like 3
  • Thanks 1
Link to comment
Share on other sites

I know quite a few mappers who shy away from editing and making their own materials, especially when special effects are involved, relying on more experienced mappers for help. Having an editor would probably open up this field to them, in a similar way to what the Readable Editor did for readables. Unlike the Readable Editor, I don't see much need for a WYSIWYG recreation inside DR, though, in particular with the new connection to TDM and hopefully auto-reloading of changed files in both DR and TDM.

I'd imagine this would be like a semi-automatic Notepad-like tool that lets you "add" stages and then "edit" them. For example, add "specularmap", "normalmap" and "editor_image" stages, insert a "stone" keyword, then maybe add a "blend" stage, edit it to "blend add" a "map" and insert i.e. a "scroll" keyword with an option to specify the speed.

This would make it easier and more convenient to make use of features listed on this iddevnet page, though I can see plenty of potential for pitfalls with regards to combinations being generated that won't work ingame. No different from doing it manually, though.

Link to comment
Share on other sites

How hard would it be to implement something that autogenerates material files?

 

For example a UI where we select the source TGA/DDS files for the normal map/specular/bumpmap and then DR auto generates the material file for it based on whats selected there. Maybe even an option to copy those files into their respective FM folders?

 

Just something to automate the process a bit more would be handy.

 

One problem with this though is the lack of a dark mode in DR would make staring at black text on a white background very uncomfortable as we look through the material files (unless i'm misunderstanding what you're proposing here). Currently I use notepad++ to edit my MTR files, because it's a lot easier to look at.

Link to comment
Share on other sites

I actually didn't plan to create a notepad replacement, because it misses the point of a Material Editor for me. Why not edit your .mtr files and hit reloadDecls in-game just as fine?

I was thinking more along the lines of the particle editor, which provides entry boxes, sliders, controls, etc. to develop the material stages. A preview is a must too.

  • Like 1
Link to comment
Share on other sites

28 minutes ago, greebo said:

I actually didn't plan to create a notepad replacement, because it misses the point of a Material Editor for me. Why not edit your .mtr files and hit reloadDecls in-game just as fine?

I was thinking more along the lines of the particle editor, which provides entry boxes, sliders, controls, etc. to develop the material stages. A preview is a must too.

Ah I see, I misunderstood what you meant sorry.

 

When you said material editor in my head I was thinking something in DR that edits the material MTR files not the textures themselves.

Link to comment
Share on other sites

Yes, the goal of that whole thing should be to make it easier for users to 1) create the materials for their missions and 2) make it easier to experiment with the various keywords and settings.

With regards to the lighting preview, I think that DR is not in a too shabby state. We added support for most material keywords and blend stages years ago, and as you can see in the particle editor the blend stages are not a problem. We even have shader expression evaluation support including simulating the rendertime, like "translate time*0.3*shaderParm6".

Link to comment
Share on other sites

Link to comment
Share on other sites

IMO a material editor would be awesome.

btw some people don't know but original idtech 4, comes with a material editor included, but I assume most don't use it, mostly because, they prefer to edit the materials by hand but this is because the material editor, like almost all original idtech 4 tools, has a tendency to crash, it can also sometimes corrupt the material definition file and is not very user friendly, so people avoid using it, but a good stable material editor, would get users i'm certain.

About what it should have and look like, first imo the most important feature of the material editor is the preview, if possible, it should be a accurate representation of how it will look like ingame, second it needs to support all original idtech 4 material key words (and of course new TDM ones), it should at lest, support materials with GLSL shader stages in the preview, supporting old ARB ones would be nice (for those working with Dhewm 3 engine for example) but I comprehend if it doesn't get included.

How it could look like, I really don't know, i've not used many material editors before to make a comparation, but imo the Unity suggestion is a good one, you guys could also look at the material editor that comes with original idtech 4 (but of course improve on it). One thing that imo it needs thou, is the ability to edit the material code by hand in the editor, if you so desire, for example, if you know a keyword by memory, you don't need to search for it, just open the material code section/tab and input the keyword by hand there.

It should be able to open and save multiple materials, found on a single .mtr file.

This is what comes to mind at the moment.    

Edited by HMart
Link to comment
Share on other sites

I had been tossing this idea around in my mind as well, but struggled to come up with a UI idea that could handle all the available material options without becoming overwhelming.

One idea I came up with was extracting all the keywords out of existing materials in order to determine which ones are used the most, and then making a "basic" configuration with only the most common ones.  This would be optimized for easily bringing in your own textures with little additional modification, and then have the "advanced" version which exposes the less common flags for building specialized materials.

On 1/24/2021 at 4:06 AM, Zerg Rush said:

Can this serve?

http://neotextureedit.sourceforge.net (FOSS)

I hadn't considered a node-based approach, but at first thought it could be well-suited for the way that material stages work.  Considering how common node systems are nowadays, it might be an intuitive way to go.  On the other hand it might add complexity to creating materials that just load a texture.

This might be a little tangential, but I didn't realize you could actually see a material's definition from inside DR until recently.  I always went hunting for the name directly in TDM's .mtr files.  It would be nice to be able to easily load an existing TDM material into the editor, make tweaks, and save it to your map-specific .mtr file.

 

Link to comment
Share on other sites

  • 1 month later...

Looks promising. I agree with peter that beeing able to configure the light used in the preview would be useful. I am not sure whether several lights are necessary, but beeing able to set the light color and texture would be useful as the lights often used in fms (torches, candles etc...) differs heavely from a plain white light.

Thanks for the effort.

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

I like it, seems to be very complete even at this early stage, it doesn't look hard to use but is obviously geared to people that already know the TDM/idtech4 material system and not for those just starting but with a good help system I'm sure anyone will pick it up fast.

I know is still WIP so perhaps this is already in the TODO, but if it is not, I also agree about configuring the lighting, on the doom 3 material editor for example, you can create any amount of lights you want and give them the color/material you want, you can also move them around.

Also besides the flat plane, cube and sphere models you can also import a custom model to preview the material on it, imo seems to be a nice feature. 

Btw greebo the Doom 3 material editor, writes a comment saying that the material was made by it, so if is not already, I think yours should do the same, personally, I think is a good way to detect what was written by hand or by the editor, good for detecting when the editor bugs out when writing the materials. 

Edited by HMart
Link to comment
Share on other sites

I agree that it could be divided into a basic and advanced section, if is not hard to do the seperation, in the basic section you cant do much, just apply diffuse, bump and specular textures and say what surface it is, wood, metal, etc, just a way to create fast basic materials and on the advanced tab, you have the real deeper material editor options, where a advanced user will work on stage effects and apply ARB/GLSL programs etc. 

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

22 hours ago, peter_spy said:

I hope you worked with a group of content creators and got regular feedback on that.

You mean, I should open a forum thread to get some thoughts before I even started? And post screenshots as soon as I have something?

It's the fricking internet after all, where nobody has to deal with anybody else in person, and you might happen to be a fun and relaxed guy in real life, but getting this tone in return when asking for feedback is not exactly what makes this funny for me. I'm always open to listen to mappers, especially mappers, but l need constructive feedback to work with.

I'm totally aware that this is not exactly a simple GUI to set up a material in 5 seconds. I have thought about having two "modes", where the simpler one hides most of the controls, where one just sets up the diff/bmp/spec triplet. It's just not there yet, and it was indeed not even the goal for this first iteration, but I can hear you guys that it looks like an airplane cockpit right now. Or maybe that simpler GUI ends up as a separate "assistant"-style dialog on top of this one? Or maybe a separate "Material Creator" GUI that is using the same preview but just features a few controls (no selecting of existing materials, just creating new ones)? Ideas?

On 1/23/2021 at 5:00 PM, greebo said:

the goal of that whole thing should be to make it easier for users to 1) create the materials for their missions and 2) make it easier to experiment with the various keywords and settings.

I've been working on the harder part of that quote, which was #2. Like the particle editor, it should be able to open existing materials, such that users can inspect and play around with them, talk about full syntax support. So I needed to make sure it is able to display every TDM material you throw at it, and looking at the now-defunct iddevnet.net materials page there are heap loads of options - that's why there are so many controls. It should be able to open any existing material, change anything in there and hit the save button without it destroying the original material syntax, which is not going to be easy.

My ToDo-List is looking like this:

  • Make DR materials reponsive to changes, so the preview reacts to it
  • Get DR to export materials that have been edited
  • Get the DR renderer up to speed, it doesn't support most of the less widely used keywords
  • Improve the lighting preview scene with configurable light parameters
  • Create that "simple" mode

Each of these steps will take weeks, so we're still at the beginning of that story.

But still, if the majority of mappers here thinks that this GUI will be a perfect waste of time, because 1) too complicated and 2) nobody wants that anyway, then please tell me right now. I'll focus on a mini-GUI with diffuse/bump/specular and forget about the rest.

22 hours ago, peter_spy said:

Still it wouldn't hurt to release this in increments, so the end users can get accustomed to the new thing.

I'm pushing the commits to github on an almost daily basis. I know that some mappers used to build DR from source for personal use. Anyway I was thinking it would be nice having an automated nightly build which is just building and publishing whatever the code currently is looking like. I don't have such a setup though, I need to spend some time playing around with Github CI, never touched it so far.

Creating a new build every day manually is too much work for me for little benefit, to be honest.

Link to comment
Share on other sites

I think I could start using and learning from this editor immediately.

Writing materials by hand, which for me is largely copy/paste/editing to serve the purpose good enough, leaves a messy result requiring a tedious rewriting fix.  Time better spent learning how to use such an editor.  Looking forward to it.  Thanks. 

 

Link to comment
Share on other sites

I'm very much looking forward to the material editor as I think it would open up a lot of the material system's potential to mappers. It'd be a major improvement over how I imagine most mappers to interact with the materials system, which is to copy an existing material, update the image paths and maybe copy-paste in something one has found in another material.

I think the main purpose of the editor is to 1) show what options are available, 2) apply them so that the mapper doesn’t have to worry about syntax. In an ideal world it’d also show an accurate preview, but I still think this is of secondary importance given the difficulty of replicating TDM’s rendering in DR and the existence of the new TDM<>DR connection feature. For mappers it’d arguably be even more realistic to view their custom materials ingame in the actual map. But for strict non-mappers there should be at least some preview support.

Maybe some “basic” or “common” settings can be identified, like diffusemap & normalmap. These are settings that are shown in “basic” mode and that the DR renderer should be able to portray.

  • Like 1
Link to comment
Share on other sites

4 hours ago, peter_spy said:

Not exactly, I meant working in modern iterative approach, where you discuss features with users first, do some mockup drawings with whatever method you prefer (everything from post-it notes and pencil drawing to apps like draw.io or invision would do). Then it's establishing the MVP. In this case it could be e.g. an editor that allows you to assign diffuse, specular and normalmap. Then it's releasing that, getting feedback from users and planning next steps – in the most simplified way of describing it. It's not about dumping the whole solution onto users, and it's not about pushing commits. It's about communication with end users and, establishing milestones and gradual releases. That's what you typically do in modern software development.

Thank you for this explanation. I've never heard of that iterative thing before, but it really sounds like it's a good approach.

Now I'm not so sure about communication with end users. How on earth should I do that?

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

    • The Black Arrow

      Any of you heard Age of Wonders 4's OST?
      https://www.youtube.com/watch?v=Q0TcoMGq4iA
      I love how after all these years, Michiel van den Bos still conserves his "Melodic" spirit.
      · 0 replies
    • nbohr1more

      Moddb article is up:  https://www.moddb.com/mods/the-dark-mod/news/the-dark-mod-212-is-here
      · 3 replies
    • Petike the Taffer

      I've been gone for a while, but now I'm back, have a new desktop and I want to get back to making missions and playing missions. And doing other contributions. Waiting for my reset password for the wiki, but I'll take a look at it soon. Hello, all.
      · 4 replies
    • snatcher

      TDM Modpack 4.0 for The Dark Mod 2.12 released!
      · 1 reply
    • nbohr1more

      Congrats to all the busy Dark Mod developers! TDM 2.12 is here!
      · 4 replies
×
×
  • Create New...