TGD Defaultness Editor

Started by WAS, May 08, 2020, 11:50:25 PM

Previous topic - Next topic

WAS

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

KyL

Sounds great! Thanks for this, it will be very useful.

WAS

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

KyL

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!

WAS

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)

KyL

That's what I thought. Adjusting luminosity would be nice too of course.

WAS

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/

KyL

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.

WAS

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.

KyL

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:

WAS

Bum bum bum. I'll check it out. It seemed to work for my lightsources and spotlights.

WAS

#26
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

KyL

Awesome! It works perfectly.

Thanks so much for this, it will be put to good use ;D

WAS

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.