Anonymous Login
2017-08-23 00:29 CEST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0000895OpenClonkEngine - Renderingpublic2017-08-12 21:40
Assigned ToLuchs 
Platform64 BitOSWindows 7OS Version-
Product Version 
Target Version8.0Fixed in Version8.0 
Summary0000895: SetMatAdjust() does not work with high resolution landscape
DescriptionI tried SetMatAdjust(RGBa(255,127,127,127)) from via console and scenario script.
TagsNo tags attached.
Attached Files





Can be closed. Found a equivalent in bugtracker.


Newton (administrator)

I can reproduce this.

SetMatAdjust does not work with high resolution landscape option on.


Newton (administrator)

PeterW can perhaps say if this is even possible to implement for the highres shader. (I don't think the function is used anywhere / doesn't make so much sense to me)


PeterW (developer)

Last edited: 2013-11-12 19:07

View 3 revisions

It is certainly possible. You'd just need to pass it to the shader and process it there accordingly. You could now even make it per-material if you really wanted to. However, you would probably want to disable this in the default case, so it doesn't end up causing performance reductions (Guenther's old shader went to some pains to do this).

So the question here is - is the use case important enough to warrant a special case? If yes, the actual change is actually not too complicated, so it might be a good project for somebody trying their hand at engine development (Paelleon?).


Newton (administrator)

Paellon is working on it


Clonk-Karl (administrator)

This has not happened, has it? Should we just drop SetMatAdjust? For a constant MatAdjust, the same effect can be achieved by overloading the landscape shader in a custom scenario. And once we have shader parameters that can be changed in C4Script, that would be a full replacement.

At the moment, only ScorchedGardens uses SetMatAdjust (and probably hasn't worked there since a while now...)


Sven2 (developer)

I agree it's not needed by default as it's another per-pixel operation done in the shader. Custom scenario shaders can now gain much more control over how to draw the landscape and other things.


PeterW (developer)

On the other hand, the "material shinyness" patch pretty much introduced exactly what's needed for this - a material property map that is sent to the shader. For example, it would be trivial now to change material's emittence dynamically.


Sven2 (developer)

That's actually a good idea. PeterW would you want to implement that?


PeterW (developer)

I could easily change SetMatAdjust to change the emittence, if that's acceptable (it's an adjustment - just a different one!). For a new dynamic property, I'd grumble a bit more, because it means yet more shader code for a fairly rare use case.


Sven2 (developer)

Yes, changing the emittence is what I had in mind.


PeterW (developer)

Hm, the current material adjustment is actually global, had not realised that. Is that how it should be? If we want it per-material, this raises the question of how we should save it. As a big NameList in the scenario core, possibly?

... what exactly would we want to use this for anyway? ;)


Clonk-Karl (administrator)

As a first step I think it's fine to just restore (the global) SetMatAdjust functionality. At the moment the function just does nothing.


Sven2 (developer)

Last edited: 2015-11-12 23:49

View 4 revisions

Yes, it would just store the global adjustment as MatAdjust in C4Landscape, synchronized/stored via Game.txt.

C4MaterialCore would keep the static value defined in the .c4m and the C4Material would have the dynamic value as the static value multiplied by the current MatAdjust. Multiplication would happen at game start (for savegame resume), on SetMatAdjust() and when a material is reloaded.

I don't think we need a Scenario.txt entry.

Individually adjustable materials sound nice, but I don't really see the use case. Maybe to do scripted material animation? (e.g.: "Boiling" lava changes its brightness between bright and very bright). But we can always add that later by adding a parametger to SetMatAdjust (SetMatAdjust(adjust) sets all materials and SetMatAdjust(adjust, material) sets only one material).


Sven2 (developer)

> ... what exactly would we want to use this for anyway? ;)

Actually, the only use case I know was in sequences, people liked to do SetSkyAdjust, SetMatAdjust and SetClrModulation on all objects to make everything except the UI darker. I guess now you can just use SetGamma?


PeterW (developer)

> the only use case I know was in sequences, people liked to do SetSkyAdjust, SetMatAdjust and SetClrModulation on all objects to make everything except the UI darker

Which would be a very bad fit for the "emittence" SetMatAdjust, because it would make everything strictly brighter.

And yeah, the best use case I could come up with would be "pulsating" Lava or Crystal - and even then it would arguably be more natural to achieve this by material texture animations (not bound to game tick) or object overlays (so you can "bloom"). Not sure...


Luchs (developer)

Not sure about all the extra discussion, but I fixed SetMatAdjust in 19395b23ae67a0a037ba887177f1281750aea50f a while back.

-Issue History
Date Modified Username Field Change
2012-12-26 11:39 user22 New Issue
2012-12-26 11:41 user22 Note Added: 0002368
2013-11-10 20:32 Newton Note Added: 0002737
2013-11-10 20:33 Newton Status new => acknowledged
2013-11-10 20:33 Newton Summary SetMatAdjust() does not work => SetMatAdjust() does not work with high resolution landscape
2013-11-12 18:57 Newton Note Added: 0002748
2013-11-12 19:05 PeterW Note Added: 0002749
2013-11-12 19:06 PeterW Note Edited: 0002749 View Revisions
2013-11-12 19:07 PeterW Note Edited: 0002749 View Revisions
2013-11-12 19:24 Newton Priority normal => low
2013-12-04 15:18 Newton Note Added: 0002795
2013-12-04 15:18 Newton Status acknowledged => confirmed
2015-10-16 02:33 Sven2 Target Version => 7.0
2015-11-10 21:35 Clonk-Karl Note Added: 0004098
2015-11-11 01:20 Sven2 Note Added: 0004099
2015-11-11 17:06 PeterW Note Added: 0004100
2015-11-11 17:09 Sven2 Note Added: 0004101
2015-11-11 17:13 PeterW Note Added: 0004102
2015-11-11 17:21 Sven2 Note Added: 0004103
2015-11-12 23:26 PeterW Note Added: 0004104
2015-11-12 23:38 Clonk-Karl Note Added: 0004105
2015-11-12 23:45 Sven2 Note Added: 0004106
2015-11-12 23:47 Sven2 Note Edited: 0004106 View Revisions
2015-11-12 23:49 Sven2 Note Edited: 0004106 View Revisions
2015-11-12 23:49 Sven2 Note Edited: 0004106 View Revisions
2015-11-13 00:10 Sven2 Note Added: 0004107
2015-11-13 10:02 PeterW Note Added: 0004109
2016-01-02 20:42 Clonkonaut Target Version 7.0 => 8.0
2017-08-12 21:40 Luchs Assigned To => Luchs
2017-08-12 21:40 Luchs Status confirmed => resolved
2017-08-12 21:40 Luchs Resolution open => fixed
2017-08-12 21:40 Luchs Fixed in Version => 8.0
2017-08-12 21:40 Luchs Note Added: 0005720
+Issue History