Not logged inOpenClonk Forum
Up Topic General / Feedback and Ideas / Lava glowing
1 2 Previous Next
- - By Carli [de] Date 2010-05-06 15:35
Hi,

an other idea of mine:
Lava could look more like lava when we would have two surfaces of the landscapes where two different textures of the lava are applied:
one texture that is normal and one texture where the gaps in the lava rocks are glowing.

The two surfaces are then faded between each other in a sine-curve so that it looks like real glowing lava.

You could also use this technique to animate water and make gold glittering.
Parent - - By AlteredARMOR [ua] Date 2010-05-06 16:56
Hm.. Nice ideas...

Though I keep wondering how will all of this stuff affect game productivity?
I am already upset a bit by the fact that I can not play OpenClonk anymore on neither of my computers due to the increased system requirements and just want to know how far is this going to go.
Reply
Parent - By Carli [de] Date 2010-05-07 08:20
when you just bind two textures and use them in the shader, there should be nearly no performance loss.
Parent - - By Enrique [de] Date 2010-05-10 19:02
I think it is a nice idea, but i am wondering weither we need there multiple textures instead of just two.
Reply
Parent - By Carli [de] Date 2010-05-10 20:48
because with two textures, you have the best performance.

you just generate two instead of one landscape surfaces, otherwise you have to redraw the surface for each different modulo.
Parent - - By PeterW [de] Date 2010-05-15 21:14 Edited 2010-05-15 21:18
Was that suggestion targeted at me? Then you need to explain it better, I don't understand it. Also doubling the amount of texture data just for a glow effect doesn't seem very attractive.

Animated water, for example, can be implemented without it by using something similar to Günther's solution.
Parent - - By Carli [de] Date 2010-05-16 08:14

>Then you need to explain it better, I don't understand it.


you have a time factor. from this, you calculate the interpolation factor:
float interpolationFactor = 0.5+0.5*sin(timeFactor)

with this interpolation Factor, you can calculate the color:
vec4 color = interpolationFactor*Texture2D(tex1) + (1-interpolationFactor)*Texture2D(tex2)
Parent - - By PeterW [de] Date 2010-05-16 11:31
Well, with my shader, obviously neither texture1 nor texture2 will just be simple lookups. But the more interesting question is: What should texture1 and texture2 contain?
Parent - - By Carli [de] Date 2010-05-16 16:34
the two landscape surfaces that are blended into each other.
one with glowing things and one without.
Parent - - By PeterW [de] Date 2010-05-16 23:39
You still haven't answered how you intend to calculate the "glowing" part. Do you mean:
* local lightening on surrounding materials (realistic, but I guess it wouldn't really show)
* have some sort of "fog" over surrounding materials, representing either real fog or some sort of "overglow"
* just have the lava itself get lighter and darker over time

Each would need a different solution.
Parent - - By Carli [de] Date 2010-05-17 08:50
some materials would have two textures.
i'll show it in an example:
Parent - - By PeterW [de] Date 2010-05-17 10:44 Edited 2010-05-17 10:46
So your idea is to have some kind of material texture animation? Hm, that's something where we could actually use the fact that the material textures are stored as one 3D texture now...

We could even have an animated bump-map! Living slime material anyone? ;)
Parent - By Caesar [de] Date 2010-05-17 12:21

>Living slime material anyone? ;)


[x]
Parent - By Carli [de] Date 2010-05-17 13:40
:)
Parent - - By Luchs [de] Date 2010-05-18 12:15
Parent - By Ringwaul [ca] Date 2010-05-18 16:09
Ech... I hope not.
Parent - By Carli [de] Date 2010-05-18 17:08
zomg
Parent - By boni [at] Date 2010-05-30 13:03
<3
Parent - - By Plotron [pl] Date 2010-05-30 23:28
You love MMOs, don't you?
Parent - - By Luchs [de] Date 2010-05-31 20:48
Not really, but I played Maple Story some time ago (and I liked it). ;)
Parent - - By Ringwaul [ca] Date 2010-05-31 23:46
I was thinking of sharing my "friendly little opinions" on maplestory... but I'd rather keep flamewars down.
Parent - - By Luchs [de] Date 2010-06-01 02:07
Flamewars aren't fun with a locked OT board. :(
Parent - By PeterW [de] Date 2010-06-03 16:32
Just migrate to the international Clonk Forum. Fluff would probably appreciate some company ;)
Parent - - By AlteredARMOR [ua] Date 2010-05-17 14:28
Thats quite nice though I suppose to have a good-looking animation effect we have to do either of:
1) Have more than 2 textures;
2) Change not entire texture but different parts of it;

Or are there any techniques that can simplify this?
Reply
Parent - By PeterW [de] Date 2010-05-18 12:49
By the way, having more than two animation phases won't be a problem - the 3d texture will just have to contain the first phase two times (like ABCA) so the last transition (CA) is smooth. I guess this is what we could use for water.
Parent - - By Newton [de] Date 2010-11-16 14:05 Edited 2010-11-16 14:07
Oh btw since a link to this popped up:
A glowing effect in this manner

>* just have the lava itself get lighter and darker over time


would be reached if the two textures (e.g. those in carli's post) are not just blended into each other but blended additively. Both textures are then constantly moved against each other.
Parent - - By PeterW [gb] Date 2010-11-16 16:13
What do you mean by additively? 3D textures would allow me to pretty cheaply blend together textures. Everything more complicated would at minimum require another branch and possibly another texture lookup. What additional functionality would you like to see?
Parent - - By Newton [de] Date 2010-11-16 17:55
Yes@cheaply

IIRC there are different blend-modes to choose from. You can select to blend them together additively (add the color values instead of using the average of the two).
Parent - - By PeterW [gb] Date 2010-11-17 16:51
Sum is only average times two. Applying some kind of factor should be the least problem. I mean, if you just want to change around brightness, I can include a variable for that and we wouldn't have to add additional textures at all? But I still fail to see why this should be useful.
Parent - - By Newton [de] Date 2010-11-17 20:38
Constantly moving two different textures against each other (while blending them additively) has a different effect than adjusting the brightness of one texture. Most importantly, it can create the illusion of an animation of the liquid if the two+ textures are chosen wisely.
Parent - - By PeterW [gb] Date 2010-11-17 22:01
Uhm, I think I have seriously lost track of what we are discussing here. What I am talking about:
----------  <- color = tex1
            <- color = (3 tex1 + tex2) / 4
            <- color = (2 tex1 + 2 tex2) / 4
            <- color = (tex1 + 3 tex2) / 4
----------  <- color = tex2


Brightness stays the same. Now doing it the way what I thought you meant by "additively":
----------  <- color = tex1
            <- color = tex1 + tex2 / 2
            <- color = tex1 + tex2
            <- color = tex1 / 2 + tex2
----------  <- color = tex2


Brightness doubles between animation phases. Actually same effect as above, with multiplicators of 1, 3/2, 2, 3/2, 1. I have no idea why this would be a good idea in any way, so I guess you meant something else. Can you explain?
Parent - - By Newton [de] Date 2010-11-18 04:00

>----------  <- color = tex1
>            <- color = (3 tex1 + tex2) / 4
>            <- color = (2 tex1 + 2 tex2) / 4
>            <- color = (tex1 + 3 tex2) / 4
>----------  <- color = tex2


Err, what? (What are those lines?)
Parent - - By PeterW [gb] Date 2010-11-18 14:12
The 2D textures. That's how 3D textures work: You bind a few layers to 2D textures, then access coordinates between them, and the GPU interpolates the color as I described.

Here's a picture, for example.
Parent - - By Newton [de] Date 2010-11-18 16:26
Cool technology. However, that was not what I was talking about. I was talking about keeping this

>            <- color = tex1 + tex2


constant but moving the textures against each other. So, the animation doesn't happen by blending one texture into another and back but by, well, moving the textures against each other.
E.g. you have two layers in GIMP, the first has the mode "additive". Then you move the first around slowly. That is what I was talking about.
Parent - - By PeterW [gb] Date 2010-11-18 18:40
Like fog moving over Lava? I feel that it would be a better idea doing that by just using particles. Most animations I can think of aren't of the "one texture moving relative to the other" variety. What do you have in mind?
Parent - - By Newton [de] Date 2010-11-18 20:01
Yes, pretty much. But I gather that it might only look good for 3+ textures which move each into different directions (or non-linear, in circles or something). If you take enough textures, and 2-3 might be enough, the player won't see any more that the animation is actually just moving different textures against each other.
This is just a suggestion though. I have not tested whether this can actually look good
Parent - - By PeterW [gb] Date 2010-11-18 20:14
Well, that's three times the texture lookup per pixel, that's bound to be costly in terms of rendering performance. I like the texture phase approach more, I'm afraid.
Parent - - By Newton [de] Date 2010-11-18 21:14 Edited 2010-11-18 21:17
I don't have the conception on how costly or not costly different methods of animation are. I just built a simple example in HTML. I just used one image for all three layers, it would look better if I made the effort to tinker different ones for each layer (Unfortunately, HTML does neither support additive blending nor sub-pixel movement of images ).

http://www.westnordost.de/misc/test.html
Parent - By PeterW [gb] Date 2010-11-18 22:04
Hm, bubbles going up or something might be worthwhile. Could also work for acid, not sure about water. Still, I'm not that happy with adding multi-texturing just for such a feature. If GPUs really don't branch-predict, that would increase the complexity of all pixel draws, even if no animated texture is visible.
Parent - - By MimmoO Date 2010-05-18 17:10
procedural textures
[/discuss]

would be cool.
Parent - - By PeterW [de] Date 2010-05-18 18:28
Why? I don't see the reasoning.
Parent - - By MimmoO Date 2010-05-18 18:36
they could be used for water, magma and other liquids, animated of course
Parent - By AlteredARMOR [ua] Date 2010-05-18 19:13
I suppose blending two different textures together as Carli suggested can be considered as a procedural texture...
We can make material texture change from time to time but hardly need something more than that.
Reply
Parent - - By PeterW [de] Date 2010-05-18 21:26 Edited 2010-05-18 21:28
Well, so can normal textures. What's your point? The only possible upside I see is that procedural textures take up less space on the disk - which isn't exactly a problem right now.
Parent - - By Sven2 [de] Date 2010-05-19 00:17
I think he meant procedural textures rendered at drawing time in shader? They'd use less texture mem; dunno if that's an issue.
Parent - - By Carli [de] Date 2010-05-19 06:36
procedural textures do also have an endless level of detail.
Parent - By PeterW [de] Date 2010-05-19 15:08 Edited 2010-05-19 15:12
They can have an endless level of detail - if you are willing to program details for all levels of detail. Or use some sort of fractal.

Either way, this is actually less important for Clonk - no matter how much we zoom in or out, we will never have as much variety in texture scalings as a typical 3D scene. Procedural textures are a solution for a problem we just don't have.
Parent - By PeterW [de] Date 2010-05-19 15:04
I seriously doubt that that's an issue, given the amounts of textures modern games use. I'd say calculating non-trivial textures in a shader is at least an order of magnitude slower.
Parent - - By MimmoO Date 2010-12-17 14:31
why should we limit on letting the texture glowing only on itself? i would find "real" glowing textures much cooler, like, lightening the materials around them.
i made a small photomanipulation to show what i mean: Glowing Lava
i think that looks really nice.
what do the engine developers say to this? would something like this be possible?
Parent - By Asmageddon [pl] Date 2010-12-17 16:17
I'm not a dev, but it definitely would be possible, either using shaders or an overlay map.
Reply
Up Topic General / Feedback and Ideas / Lava glowing
1 2 Previous Next

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill