Board index FlightGear Development Effects and shaders

Propeller blur shader

An exciting "new" option in FlightGear, that includes reflections, lightmaps, the particle system etc.. A lot is yet to be discovered/implemented!

Re: Propeller blur shader

Postby TheEagle » Mon Nov 21, 2022 11:49 pm

Yeah, the car tire seems like a good idea ! :) I tried swirling a pencil - while I can't reach 600 RPM twisting a pencil between my fingers, I did observe something - rather than producing a uniform blur of a quarter circle, I saw like 10 copies of a blurred pencil ! I don't think though that this can be copied to high speeds.
Cessna 210 (Wiki)
My other aircraft: my wiki profile !
Other: FGTools (GitHub)
World tour: View on SkyVector
Please consider donating $1 / €1 to help me finance a new camera !
User avatar
TheEagle
 
Posts: 3433
Joined: Sat May 01, 2021 3:27 pm
Location: France
Pronouns: You, he
Callsign: F-EAGLE
IRC name: none
Version: Git next
OS: Ubuntu Studio 22.04

Re: Propeller blur shader

Postby merspieler » Tue Nov 22, 2022 12:13 am

I saw like 10 copies of a blurred pencil


in natural or artificial light?
if artificial that will be the reason as the light basically goes "off" and on 50-60 times a second acting like a fast stroboscope.
Nia (you&, she/her)

Please use gender neutral terms when referring to a group of people!

Be the change you wish to see in the world, be an ally to all!

Join the official matrix space
merspieler
 
Posts: 2298
Joined: Thu Oct 26, 2017 11:43 am
Location: Wish to be in YBCS
Pronouns: you&, she/her
Callsign: you&, she/her
IRC name: merspieler
Version: next
OS: NixOS

Re: Propeller blur shader

Postby TheEagle » Tue Nov 22, 2022 2:03 am

artifical light - a neon lamp - that explains it of course, thanks ! :)
Cessna 210 (Wiki)
My other aircraft: my wiki profile !
Other: FGTools (GitHub)
World tour: View on SkyVector
Please consider donating $1 / €1 to help me finance a new camera !
User avatar
TheEagle
 
Posts: 3433
Joined: Sat May 01, 2021 3:27 pm
Location: France
Pronouns: You, he
Callsign: F-EAGLE
IRC name: none
Version: Git next
OS: Ubuntu Studio 22.04

Re: Propeller blur shader

Postby MariuszXC » Tue Nov 22, 2022 12:01 pm

Ysop wrote in Mon Nov 21, 2022 10:47 pm:Continued from the C310 thread:
How to help you finding the most realistic impression? Maybe at best find something from everyday experience.


How about a room fan? Not the ceiling type (usually too slow), but the desk or floor standing type? Ideally powered via a dimmer or other means of speed control.
Of course in natural light.
INOP
MariuszXC
 
Posts: 1062
Joined: Tue May 18, 2021 5:38 pm
Location: Europe
Callsign: SP-MRM
Version: 2020.4
OS: Ubuntu 16.04

Re: Propeller blur shader

Postby merspieler » Tue Nov 22, 2022 12:02 pm

that would work tho usually those have way wider blades than a prop...
so fine for blur, but be careful with it for judging transparency.
Nia (you&, she/her)

Please use gender neutral terms when referring to a group of people!

Be the change you wish to see in the world, be an ally to all!

Join the official matrix space
merspieler
 
Posts: 2298
Joined: Thu Oct 26, 2017 11:43 am
Location: Wish to be in YBCS
Pronouns: you&, she/her
Callsign: you&, she/her
IRC name: merspieler
Version: next
OS: NixOS

Re: Propeller blur shader

Postby Thorsten » Tue Nov 22, 2022 1:16 pm

It is a simple, non magical problem to compute.

Take the read-out rate of the eyes - 30 fps. Assume for the sake of simplicity that this is constant and exact.

For any speed, compute what fraction of the scene is covered in a single frame by the propeller. As simple example, imagine a linearly moving fast object. If it moves twice its diameter, cover that part of the scene with 1/2 opacity. If it moves four times its diameter, cover all that region with 0.25 opacity.

If it moves several times around like a propeller, use the relation of propeller to whole 'ring' at each distance to compute opacity.

It actually works like that...
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: Propeller blur shader

Postby Maerchenprinz » Tue Nov 22, 2022 4:59 pm

Thorsten wrote in Tue Nov 22, 2022 1:16 pm:It is a simple, non magical problem to compute.

Unfortunately no, that would have made the books I once had to read much thinner! :)
There's already some processing going on at such a "low-level" that not every receptor that crosses a certain threshold automatically triggers even a ganglion. I could dig my nose deeper into some literature about that when I feel the motivation to, but please notice the ''had to" part of my first sentence... :D May take (at least) a while! So I'd rather go with the "vent" approach, or another approach which involves the evocation of the experience of a circular movement, aka prop-plane-spotting!
To add something useful to the discussion: I think a computational approach may lead to some good basic numbers, but the actual simulation of the visual experience of a real prop (even as 2d on different screens at differing light-levels!) needs some tuning by a "real-life"-experience.

Ciao,

Adrian
User avatar
Maerchenprinz
 
Posts: 306
Joined: Thu Mar 15, 2007 6:24 pm
Location: Bochum, it's better, much better than you think!
Callsign: Adrian

Re: Propeller blur shader

Postby Thorsten » Tue Nov 22, 2022 6:45 pm

There's already some processing going on at such a "low-level" that not every receptor that crosses a certain threshold automatically triggers even a ganglion.


What does that sentence even mean?

A ganglion is a cluster of nerves (mostly a kind of 'insect brain') i.e. that's a term belonging to physiology. What exactly does it mean to 'trigger' it - it's by far too complex a structure to be 'on/off' such that vocabulary like 'trigger' would apply.

What do you possibly mean by 'a receptor that crosses a threshold automatically triggers' - of course not every receptor triggers at a given threshold - but THE threshold of a receptor is when it triggers. Of course not every receptor that is fired enters visual processing (otherwise we'd be flooded with spurious signals like all sorts of organic noise).

And just what has any of this to do with the particular problem of perception of moving stuff?

As far as I can see that's a sentence with rather fancy words which don't contain much meaning, sorry.
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: Propeller blur shader

Postby Maerchenprinz » Wed Nov 23, 2022 1:01 pm

Thorsten wrote in Tue Nov 22, 2022 6:45 pm:As far as I can see that's a sentence with rather fancy words which don't contain much meaning, sorry.

May I ask what makes you conclude with such an obvious offensive sentence? - Because of a sloppy sentence that I wrote in a lazy "Sunday afternoon" mood, you are able to judge that I use "fancy" words" to show-off something I don't understand? Fun fact: I have studied Psychology (though I have to admit, a long time ago), with a bias to Neuro-, Bio- and Evolutionary-Psychology; That doesn't make your tries to "teach me" more offensive though, just more ridiculous...
That sentence was just to introduce that using a computational approach seems to me a good starting point but will not be able to walk the whole complex path from photon to "personal experience". So I didn't think that someone here really needed to read a treatise of visual perception with standard technical terms to understand my (no more than subjective) advice ("vent"- vs. "physiological-computational"-approach). No more. Making a psychogram out of that is really, uhm, at least 'interesting'.
You gave an example of what you accuse me by writing that btw:
Thorsten wrote in Tue Nov 22, 2022 6:45 pm:What do you possibly mean by 'a receptor that crosses a threshold automatically triggers'
to
Thorsten wrote in Tue Nov 22, 2022 6:45 pm:with spurious signals like all sorts of organic noise).
Now THAT is fancy rubbish! Just sluggish or can't you do better? Or is it just because you think that you talk to void like talking to an ape who wouldn't understand anyway?o

Ciao,

Adrian
User avatar
Maerchenprinz
 
Posts: 306
Joined: Thu Mar 15, 2007 6:24 pm
Location: Bochum, it's better, much better than you think!
Callsign: Adrian

Re: Propeller blur shader

Postby TheEagle » Wed Nov 23, 2022 4:21 pm

Coming back to topic … I've done a rewrite of the code and it now looks better than before ! :) In addition I've added some basic lighting calculations from default.frag including compositor shadowing and lighting … but there is a problem - there are landing lights positioned behind and a little aside of the props on the 310A, which I have modelled using compositor lights. and they are supposed to also illuminate part of the propeller blur disk - but on the back-facing side, not the front ! Basically the compositor light shines through the prop blur but doesn't at least light the back side in the process. This is the relevant code:
Code (prop-blur.frag): Select all
varying vec3 normal;
varying vec4 vertex;

// If gl_Color.a == 0, this is a back-facing polygon and the
// normal should be reversed.
n = (2.0 * gl_Color.a - 1.0) * normal;
n = normalize(n);

fragColor.rgb += getClusteredLightsContribution(vertex.xyz, n, base.rgb);

Code (prop-blur.vert): Select all
varying vec3 normal;
varying vec4 vertex;

vertex = gl_Vertex;
normal = gl_NormalMatrix * gl_Normal;

What could be wrong ? Multiplying vertex.xyz and n with 0.0 in the call to getClusteredLightsContribution has no effect at all …
Cessna 210 (Wiki)
My other aircraft: my wiki profile !
Other: FGTools (GitHub)
World tour: View on SkyVector
Please consider donating $1 / €1 to help me finance a new camera !
User avatar
TheEagle
 
Posts: 3433
Joined: Sat May 01, 2021 3:27 pm
Location: France
Pronouns: You, he
Callsign: F-EAGLE
IRC name: none
Version: Git next
OS: Ubuntu Studio 22.04

Re: Propeller blur shader

Postby Thorsten » Wed Nov 23, 2022 6:27 pm

May I ask what makes you conclude with such an obvious offensive sentence? -


I believe I outlined my reasoning quite clearly inside the post above, including what I think makes no sense.

Because of a sloppy sentence that I wrote in a lazy "Sunday afternoon" mood, you are able to judge that I use "fancy" words" to show-off something I don't understand?


That I didn't say - I said the sentence doesn't appear to contain a meaning or relevance for the topic - I did not speculate about your mood, or whether you are a show-off.

I have studied Psychology (though I have to admit, a long time ago), with a bias to Neuro-, Bio- and Evolutionary-Psychology;


That is indeed fun to hear, but also doesn't explain what your sentence has to do with the topic.

That sentence was just to introduce that using a computational approach seems to me a good starting point but will not be able to walk the whole complex path from photon to "personal experience".


The salient point here seems to me that the distribution of incoming light when separated in discrete timeframes is a physical quantity that we can know and compute - and that has no real way of being different from a semi-transparent disc for reasons of physiology (the mentioned finite read-out time of the rods and cones in the retina).

Which means that if there are perception effects (which I'll be the last person to argue away) they have to be the same for the fast-moving propeller and a semi-transparent sheet of plastic that produces the same distribution of light.

So there's that.

Making a psychogram out of that is really, uhm, at least 'interesting'.


It would be if anyone had done that - but in fact it's been only you, I have merely commented on the content of one sentence and (intentionall) refrained from drawing any conclusions from that.

Which is to say - I know it's bollocks to judge a person from one sentence - which is why I was not doing it. Please read my post again and you'll look in vain for any psychogram-type statement.

Now THAT is fancy rubbish! Just sluggish or can't you do better? Or is it just because you think that you talk to void like talking to an ape who wouldn't understand anyway?


I in fact can't do better - I know in fact quite well how nerve cells or neural networks operate (and I have modeled such things mathematically) - but I do not know much medical terminology. 'Noise' in a sensor is a well-defined term in math, it means that there's a signal generated without a cause (aka the sensor fires without light - might Phosphenes be known to you? That's some of the noise I am talking about...) it is there in the eye just as well, it is filtered out by the perception processing later (most of the time) - that I also know.

Alas - by which words you might know that phenomenon I do not. :(

Or is it just because you think that you talk to void like talking to an ape who wouldn't understand anyway?


I do not see you as an ape - if you prefer to denote yourself that way, be my guest - but kindly don't blame me.
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: Propeller blur shader

Postby property_tree » Thu Nov 24, 2022 3:35 pm

Perhaps the meaning was:
Even if you can compute something, it will not necessarily be true to life, or just unfeasible, computation wise to attempt it.

Perhaps there's a subtlety in perceiving a propeller IRL, 'modulated' by the shadow casts by the physical propeller, which in turn introduces a subtle strobe that somehow affects perception and makes it difficult to model for 'a videogame'.

I, myself, have been thinking about a shader that gives the effect of the propeller 'flying off' or 'wobbling' like it does with (digital) cameras.
That too would not be what an eye sees, but, sitting in a simulation, looking at a screen, and, well, if all you know about flying is footage from those cameras, then that would look more real to you, even though it technically is not.

Or effects like boke, lens flare, 'dirt', chromatic aberration that is (overused imho) to make things look 'more real' because that way, the report of something fantastical that the everyday man might not be able to see (in this case flying, in other cases, an action movie or a magical fantasy epic) looks more closely to the real substitute that is used to 'see' it in the first place.

That's just speculation though.
In fact, I'm kind of in the camp of "why not just do it like the cessna 172p" where its just texture. In fact, the propeller takes me out of it less than the kind of lawnmower like sound of the plane.

Tangentially I am now reminded of a 'haunted house' I was in once, and they made light (as in weight) chains feel heavy and menacing by tying their swinging to carefully timed strobes and sounds.
Which, even though that's just one example, keeps me in the aforementioned camp.

Not saying I wouldn't appreciate a really spiffy propeller but...when it spins real fast then I lose interest in appreciating its details "naturally".
The faster something goes, the more blurry it is, and knowing this, I automatically put those things on the backburner. Not like I'd be able to see fine engravings or paintjobs on it in anything other than a smear.


Edit:
I took a look at your test video, Eagle, and I both like this shader and kind of dislike it.
I think it looks best when it doesn't show any excessive 'discrepancies', when everything is smooth (aka...more or less solid (as much as a blur can be solid) disk.

All those breaks in it, the pattern breaks..they make me think of microstutters/glitches more than any physical realism.

I realize you worked on this a lot, and this is not bad, but I think propeller blurs benefit more from artistic liberties than realism, at least in a "everyday computer program"
(aka, it's not a film production or a batched raytrace or whatever)

Sometimes artistic liberties improve the overall subject.
I can cite two 100% sure examples of this.

'Draftsmen' (drawers? draw artists?) painters and other such people, when illustrating (human) eyes from the side, they tend to invert the pupil/iris a bit.
Technically that's wrong, but it LOOKS better.
LIke, this is seen well in cats. If you look at a cats eye from the straight side, you see that big transparent lens, and then basically a thin thin thin thin sliver of iris and whatnot.

This is often embellished by artists, not much, but it IS a stylistic breakage of reality to add 'humanity' to it. A better ...vision, a better 'feel'.

On an almost completely different point on the spectrum:
Cel/cartoon/anime shaded 3d avatar eyes.

People have been breaking their heads over those to make them look good, but to this day, to my knowledge anyway (maybe they finally found a different way).
The eyes of these avatars are 'rendered' by not even having a sclera, the eyewhite. Instead the white of the eye is 'rendered' with a 'bowl' so to speak.
Completely inverted to reality. As if the eyeball doesn't curve outwards, but inwards, but with the iris still at the front.

And while that sounds ...awful, it gives the best and most convincing result.

Or related to that:
Making 3d animation look 2d, by deliberately cutting out 'inbetweens' between keyframes to remove the smoothness the computed, interpolated bone positions have.

Or in traditional animation, breaking joints of characters, like breaking knees and elbows to bend them in unnatural ways during motion, but the net gain is a better, more convincing perceived motion.

So yeah, if this project ever drains your soul too much.
Let me tell you that a consistent blur, at least to me, personally, my own personal opinion that is not meant to demotivate at all...looks better than flickering "more realistic" things.
Again, that made me wonder if you had micro frame lags, when the smooth blur in full spin suddenly had a little bit of a 'gap'.

don't know if that is realistic, but what it made me think was: oh...did the renderer hiccup just now?

The 'flag like' effect of low RPM looked also a bit unnatural to me but...at least that didn't look like the renderer had a short hiccup.
property_tree
 
Posts: 98
Joined: Wed Oct 26, 2022 1:13 pm

Re: Propeller blur shader

Postby Thorsten » Fri Nov 25, 2022 7:18 am

Perhaps there's a subtlety in perceiving a propeller IRL, 'modulated' by the shadow casts by the physical propeller, which in turn introduces a subtle strobe that somehow affects perception and makes it difficult to model for 'a videogame'.


Or perhaps it's not, perhaps it's really down to seeing a blurred disc. During my time learning to fly gliders, I've seen the props of a dozen tow planes over and over, under sunny conditions, in shade, once even on a winter session... There's no magical perception effect, it is really down to a blurred disc, and the amount of transparency follows the expected pattern.

The merit of the 'many transparent copies' approach I see is that it works also when seen from the side AND gets the sun reflection correct - this is something a simple blurred disc does not. But these (hate to stress the point again) are physical properties - reflection angles, time fraction obscured vs. unobscured - and have nothing to do with the perception apparatus.

Perception also isn't magic, is follows rules that can be (approximately) calculated just as well - the way we perceive vastly different light intensities is for the most part just down to adding logarithms, the way we perceive very weak light as blue is predictable,... you can learn the rules and compute them.

Or effects like boke, lens flare, 'dirt', chromatic aberration that is (overused imho) to make things look 'more real' because that way,


No, they do not - they're art. Video game aesthetics - people are by now used to see them in certain contexts and expect them, just as we're used to seeing cartoon characters as flat, shadowless shapes and we'd be disappointed if they were drawn with full shading.

Art is something else, art is a code you can 'learn' by looking at if often enough and it is to a high degree arbitrary.
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: Propeller blur shader

Postby property_tree » Fri Nov 25, 2022 1:46 pm

>No, they do not - they're art. Video game aesthetics - people are by now used to see them in certain contexts and expect them, just as we're used to seeing cartoon characters as flat, shadowless shapes and we'd be disappointed if they were drawn with full shading.
Wrong.
They're movie aesthetics emulated by videogames to make videogames look more real, because 'movies look real'.
Now, movies can be unrealistic, of course. But bokeh, chromatic abberration, lens flares etc are all real physical aspects of a camera/film etc.

If you therefore slap a lens flare on a light source in a videogame, it then is emulating something more real than itself, so to speak. Since a virtual camera does not have lens flare, it's all maths.
But a real camera has lens flare. Granted, these things are actually nuisance effects, usually, but...they're still part of the realism.

It's also why digital animators add film grain, subtle drop shadows, slight 'shakes' of the virtual cels, some even go so far as giving the digital layers a tiny tiny smidgen of opacity to emulate the 'lightening effect' of reallife stacked cellophane sheets, sheets not being completely flat on the stack because the photographer didn't flatten them.
Slight misalignment of cels because a human slotted them onto prongs with holes and there was a little bit of play to facilitate this insertion, etc.

These effects do not exist in the 'cartoon', they are not part of the 'cartoon', only the drawings are, the cartoon should not have these aspects, but they're part of the physical media the cartoon is made with.
The cellophane sheet is a sliver of plastic that is raised and thus the paint on it can drop a shadow.

And the makers of animation, at least traditional animation were aware of this. In fact, these things were nuisance effects too. Just recently i listened to a commentary track of the ninja scroll anime movie where one of the creators cringed at one particular scene where one part of the character changed brightness due to that.
He didn't like it. But some digital animator out there, is trying his best to emulate it to make the 2d animation look more 'real'.

As for 'computing everything' yeah, that's possible, but not always feasible.
People, to my knowledge, have theorized advanced gpu/graphics stuff 100 years ago, but simply did not have the hardware to realize concepts like tesselation and the like.

Now i there's really a strobe effect or some subtlety, I don't actually know.
My point is mostly that sometimes artistic liberty and crafted design can help convey reality even if it's technically not real.


Like the wrong eyes even realism painters often add, because even while seeing a thin sliver of iris from the side, cheating it gives a more pleasing result.
In other words, trickery can aid perceived realism. And can be vastly cheaper, processing wise, on top of it all.
property_tree
 
Posts: 98
Joined: Wed Oct 26, 2022 1:13 pm

Re: Propeller blur shader

Postby Thorsten » Fri Nov 25, 2022 8:10 pm

But a real camera has lens flare.


Sure.

Though I don't know about you, I myself see with my eyes rather than with a camera - and my eyes do not have lens flare. Realism for me is seeing with eyes, not with a camera. So there's that :D

But some digital animator out there, is trying his best to emulate it to make the 2d animation look more 'real'.


Sorry, to call a 2d cartoon 'more real' is absurd in itself - it's a form of abstract art, that's all there is to it.

People, to my knowledge, have theorized advanced gpu/graphics stuff 100 years ago, but simply did not have the hardware to realize concepts like tesselation and the like.


I kinda doubt that as the Z2 (which could be argued to be the first computer) was built in 1940. Tesselation on the other hand is routinely done in games.

Like the wrong eyes even realism painters often add, because even while seeing a thin sliver of iris from the side, cheating it gives a more pleasing result.


Here we disagree - I do not think that 'a more pleasing result' equals a ;realistic result' - the two are sometimes really different. Reality isn't always pleasing (which is why art was created I guess...)

In other words, trickery can aid perceived realism. And can be vastly cheaper, processing wise, on top of it all.


In a sense 3d rendering is a lot of trickery, yes. But this is a different question as trickery can be used to produce art as well as realism.

What is cheaper processing-wise is yet another question - toon shading for instance is surprisingly complicated - it's a much harder problem than the propeller.
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

PreviousNext

Return to Effects and shaders

Who is online

Users browsing this forum: No registered users and 5 guests