Planetside Software Forums

General => Terragen Discussion => Topic started by: WAS on May 08, 2020, 11:50:25 PM

Title: TGD Defaultness Editor
Post by: WAS on May 08, 2020, 11:50:25 PM
Was bored, and it seemed like a fun idea as I haven't messed with DOM in over a decade, so I created the TGD Defaultness Editor originally based on drju's need to edit translucency of many objects, which than got me thinking about my friends old xfrog volumes with no translucency, and how that would be a pain today. The idea here is you can throw all of your objects into a single project (or just what objects you need at the time in your working project) and then edit all the default shaders located in that project. I left out functions, as I didn't it was too necessary but I may be wrong, as this could be used for more than just editing translucency of an object/defualt shader.

https://pnwnetwork.com/defaultness

Supports:


Notes:

Title: Re: TGD Defaultness Editor
Post by: Dune on May 09, 2020, 01:47:14 AM
That looks interesting, and a classy look too! But I can never get on the web from my working machine, so I would be interested to have an offline version. Maybe never need it, but very good to have in the toolbox.
Title: Re: TGD Defaultness Editor
Post by: WAS on May 09, 2020, 03:08:38 AM
Quote from: Dune on May 09, 2020, 01:47:14 AMThat looks interesting, and a classy look too! But I can never get on the web from my working machine, so I would be interested to have an offline version. Maybe never need it, but very good to have in the toolbox.

Oh that's right. I was curious of PHP Desktop would work with it, it's basically a tiny chromium browser with PHP built in, but alas it doesn't work on XP, and apparently it's document object model is broken. Opening a project yields all blank results. I'd have to port it to another language and GUI framework.

If you're willing to install PHP/WAMP Server on your machine from thumbdrives it would work. I developed it off WAMP Server and slapped it on my host with a cronjob to delete everything in the temp directory.

Update: I was able to get it working for Windows 7+ version of PHP Desktop (see screenshot)
Title: Re: TGD Defaultness Editor
Post by: cyphyr on May 09, 2020, 04:09:40 AM
Looks interesting. Thankyou.

I use a lot of KitBash3d Models that I have to convert through Lightwave.
The models come as a single model with about 30 buildings in it plus extras. Each building has to be separated out, world centred and exported as an obj.
Unfortunately Lightwaves obj exporter breaks the image paths so every time I import a building to Terragen I have to fix between 5 and 10 default shaders.
Mostly I do this by editing the .mtl file in notepad before the import but obviously I have to do this for each model.
This tool may provide a way of editing a whole set of models at once.
Title: Re: TGD Defaultness Editor
Post by: Kadri on May 09, 2020, 04:35:10 AM
Looks useful indeed. Nice.
Title: Re: TGD Defaultness Editor
Post by: mhaze on May 09, 2020, 06:49:34 AM
Would really like to see this developed.
Title: Re: TGD Defaultness Editor
Post by: Hannes on May 09, 2020, 08:13:36 AM
Cool idea!! Thanks for the work, Jordan!
Title: Re: TGD Defaultness Editor
Post by: sboerner on May 09, 2020, 11:34:51 AM
Looking forward to trying this! Handy to see all of the attributes shown in a spreadsheet-like view. Thanks!
Title: Re: TGD Defaultness Editor
Post by: WAS on May 09, 2020, 03:07:36 PM
Quote from: cyphyr on May 09, 2020, 04:09:40 AMLooks interesting. Thankyou.

I use a lot of KitBash3d Models that I have to convert through Lightwave.
The models come as a single model with about 30 buildings in it plus extras. Each building has to be separated out, world centred and exported as an obj.
Unfortunately Lightwaves obj exporter breaks the image paths so every time I import a building to Terragen I have to fix between 5 and 10 default shaders.
Mostly I do this by editing the .mtl file in notepad before the import but obviously I have to do this for each model.
This tool may provide a way of editing a whole set of models at once.

That's a good point with exporting from other formats. Even Blender can mess up materials exporting to obj.

I think also it may be appropriate to read off the image map shaders too, since their paths can be effected with project migrating when not gathered, and also various settings which may need altering if changing maps altogether.

Thanks for the comments everyone.
Title: Re: TGD Defaultness Editor
Post by: WAS on May 09, 2020, 04:32:52 PM
Added image map support to web version. I have a version that can work offline, but it will only work in Windows 7+. I'd like to find an option that will work on XP. I know two people that use XP still with TG.
Title: Re: TGD Defaultness Editor
Post by: N-drju on May 11, 2020, 07:29:25 AM
This is useful on countless occasions. Good job.
Title: Re: TGD Defaultness Editor
Post by: KyL on May 26, 2020, 09:13:03 AM
That's really neat. Thanks for this WAS.

May I push a bit and ask if you could do something similar for Lights? I think it would be really awesome to have a light tool editor. For example copy the lights, paste them and be able to randomize their intensity and color based on a given range.

There are already tools for this in Maya for example, but when you export through FBX you cannot set the Radius, soft shadows, soft shadows samples, ect... Only the strength and color get carried in Terragen and having to use Maya for this is quite cumbersome!
Title: Re: TGD Defaultness Editor
Post by: WAS on May 26, 2020, 02:56:08 PM
Quote from: KyL on May 26, 2020, 09:13:03 AMMay I push a bit and ask if you could do something similar for Lights? I think it would be really awesome to have a light tool editor. For example copy the lights, paste them and be able to randomize their intensity and color based on a given range.

There are already tools for this in Maya for example, but when you export through FBX you cannot set the Radius, soft shadows, soft shadows samples, ect... Only the strength and color get carried in Terragen and having to use Maya for this is quite cumbersome!

Seems like a interesting idea. Do you mean edit a project files light sources, or a lightsource populator? Both are doable, though an editor would be more straight forward.
Title: Re: TGD Defaultness Editor
Post by: KyL on May 26, 2020, 03:20:49 PM
Probably a project file light source. This would not create lights, but rather mass modify lights parameters in a more customizable way that with a default text editor.

The idea I had in mind would be to be able to vary the intensity and color of all lights in a project. For example say you want the intensity to be 100 with a 10% random, and all the lights get a value between 90 and 110.
I imagine the same could be done for colors by giving a specific rgb value then vary the Hue by the desired percentage as well.
Title: Re: TGD Defaultness Editor
Post by: WAS on May 26, 2020, 05:26:47 PM
I have moved all the tools over to NWDA's Resource Section (https://nwdastore.com/resources) under Terragen -> Tools
Title: Re: TGD Defaultness Editor
Post by: WAS on May 26, 2020, 05:28:24 PM
Quote from: KyL on May 26, 2020, 03:20:49 PMProbably a project file light source. This would not create lights, but rather mass modify lights parameters in a more customizable way that with a default text editor.

The idea I had in mind would be to be able to vary the intensity and color of all lights in a project. For example say you want the intensity to be 100 with a 10% random, and all the lights get a value between 90 and 110.
I imagine the same could be done for colors by giving a specific rgb value then vary the Hue by the desired percentage as well.

I think this is doable. For now I have made a basic light source editor (it's under the Terragen Tools section). What I'll implement is another field after the intensity field, which will be a variance percentage. it will than generate a random variance based on that cap, and apply it to the base value you input (upon downloading).
Title: Re: TGD Defaultness Editor
Post by: KyL on May 26, 2020, 06:13:11 PM
Sounds great! Thanks for this, it will be very useful.
Title: Re: TGD Defaultness Editor
Post by: WAS on May 26, 2020, 07:31:24 PM
Quote from: KyL on May 26, 2020, 06:13:11 PMSounds great! Thanks for this, it will be very useful.

One thing is, I assume you want to edit importer objects default shader luminosities? This may prove to be a challenge. It seems this setting is just a vector representative of scalar values translated to RGB. For example a red luminosity of 5 is 5 0 0. Trying to figure out how this is handled to even apply any variance. Obviously a normal red RGB value is 255, 0, 0

@Matt could you shed some light on the luminosity value? Never mind, I think I figured out a method of conversion.
Title: Re: TGD Defaultness Editor
Post by: KyL on May 26, 2020, 08:34:42 PM
Ah no, I am talking about actual lights (light source or spotlights)

In that case the parameters are mainly color (r,g,b) and intensity!
Title: Re: TGD Defaultness Editor
Post by: WAS on May 26, 2020, 08:38:00 PM
Quote from: KyL on May 26, 2020, 08:34:42 PMAh no, I am talking about actual lights (light source or spotlights)

In that case the parameters are mainly color (r,g,b) and intensity!

Yes, definitely much easier. But I think converting the vector values in the XMLs is just a matter of value / 255 (to get a RGB range). Since 5 0 0 represents 1,275 0 0 in RGB (255 * 5 for Red Channel)
Title: Re: TGD Defaultness Editor
Post by: KyL on May 26, 2020, 08:41:17 PM
That's what I thought. Adjusting luminosity would be nice too of course.
Title: Re: TGD Defaultness Editor
Post by: WAS on May 27, 2020, 03:40:12 PM
Quote from: KyL on May 26, 2020, 08:41:17 PMThat's what I thought. Adjusting luminosity would be nice too of course.


Can you test this out, KyL? I did some testing, but needs more. It won't apply any variance and act as an editor only if you don't "Apply" the variance to a shader set. It should only read default shaders with luminosity.

https://nwdastore.com/terragen-tools/lightsource/
Title: Re: TGD Defaultness Editor
Post by: KyL on May 27, 2020, 04:16:31 PM
Thanks. I uploaded a scene file containing a fair amount of spotlights, however I couldn't find how to "Apply" the variance? It actually lists all lights in the scene correctly though.
Title: Re: TGD Defaultness Editor
Post by: WAS on May 27, 2020, 04:21:58 PM
Quote from: KyL on May 27, 2020, 04:16:31 PMThanks. I uploaded a scene file containing a fair amount of spotlights, however I couldn't find how to "Apply" the variance? It actually lists all lights in the scene correctly though.

It's the checkboxes under the variance settings.
Title: Re: TGD Defaultness Editor
Post by: KyL on May 27, 2020, 04:25:38 PM
It didn't work then. When I opened the downloaded file the values were exactly the same as the original file :/

Here is the tgd I tried:
Title: Re: TGD Defaultness Editor
Post by: WAS on May 27, 2020, 04:27:57 PM
Bum bum bum. I'll check it out. It seemed to work for my lightsources and spotlights.
Title: Re: TGD Defaultness Editor
Post by: WAS on May 27, 2020, 04:45:50 PM
Quote from: KyL on May 27, 2020, 04:25:38 PMIt didn't work then. When I opened the downloaded file the values were exactly the same as the original file :/

Here is the tgd I tried:

Woops. So I changed the logic of one of my functions to reflect a change elsewhere, but forgot to flip the condition in the code, so what should have been a "true" was being sent a "false". Give it a go now.

Example of your file with 10% variation to everything: Screenshot_187.jpg
Title: Re: TGD Defaultness Editor
Post by: KyL on May 27, 2020, 07:02:04 PM
Awesome! It works perfectly.

Thanks so much for this, it will be put to good use ;D
Title: Re: TGD Defaultness Editor
Post by: WAS on May 30, 2020, 12:41:09 AM
Recently discovered a issue with DOM, @blinkfrog 's Classic Erosoin contains "::" in the shader name, which is used as the tag name in XML, which is a invalid QNAME and will break the parser. Qnames use the colon to denote tag meta data, and a double colon trips this functionality, as do spaces after the colon.  So unfortunately projects with these shaders will either fail partially or completely upon loading the project.