Lights and Shadows in Graphics - Computerphile

  Рет қаралды 160,267

Computerphile

Computerphile

10 жыл бұрын

Audible free book: www.audible.com/computerphile
The latest film of our series on graphics sees John Chapman turning the lights off to explain how we decide if a pixel is in light or shade...
John Chapman is a graphics programmer who blogs here: www.john-chapman.net
Graphics series with John Chapman: • Triangles and Pixels
1/ Universe of Triangles : • A Universe of Triangle...
2/ Power of the Matrix : • The True Power of the ...
3/ Triangles to Pixels : • Triangles to Pixels - ...
4/ Visibility Problem : • The Visibility Problem...
5/ Light and Shade in Computer Graphics: • Lights and Shadows in ...
/ computerphile
/ computer_phile
This video was filmed and edited by Sean Riley.
Computerphile is a sister project to Brady Haran's Numberphile. See the full list of Brady's video projects at: bit.ly/bradychannels

Пікірлер: 249
@NutzlastB0hne
@NutzlastB0hne 10 жыл бұрын
Teachers who introduce vectors and matrices should tell their pupils how important this stuff is for games and movies! Back in school I didn't really understand what all those calculations could be used for... when I later understood how games are rendered, it hit me like a brick! And It's not only that you now know where this stuff comes into practice, the purpose of planes, normals etc. is also much easier to grasp!
@mkaatr
@mkaatr 10 жыл бұрын
Just imagine the huge amount of calculations done by the time you finish playing a game :) Knowing these techniques make your really appreciate the machine doing the work, and the research done to make 3D games possible.
@20electric
@20electric 10 жыл бұрын
I would listen to him for hours on all these subjects.
@ErichBrutus
@ErichBrutus 9 жыл бұрын
More on this series please! Me personally would be interested in hearing more about normals: vertex vs face normals, normal maps, normals in split edges etc.
@thecassman
@thecassman 10 жыл бұрын
I remember the lectures for my Graphics Module in my degree really well and i always struggled to keep my concentration... I always blamed it on the way my lecturer taught it and now i'm convinced it's that... This guy makes it much clearer.
@antivanti
@antivanti 10 жыл бұрын
Here is another video about rendering history by one of the true masters. The Physics of Light and Rendering | A Talk by John Carmack
@majoro7251
@majoro7251 7 жыл бұрын
PLEASE make one for shaders. This series is great so far. And shaders/shader programming is a fringe subject. Many thanks from Syria. By the way, guy is a genius. Underestimated John in his video (power of matrix) until he mentioned importannce of using them for performance. Then I decided to watch this whole series.
@slpk
@slpk 10 жыл бұрын
Brady and Sean, I and many other have been requesting this channel for ever. You guys have made it the absolute best it can be. We thank you!
@richbuilds_com
@richbuilds_com 6 жыл бұрын
This has been a brilliant series. Answered a lot of n00b questions I had. Very well presented by someone who obviously understands the process and can articulate it. Bravo!
@WhatforNameIsThat
@WhatforNameIsThat 10 жыл бұрын
This series of videos was really interesting. With the videos edited to 7 to 10 minute blocks make them easily consumable over multiple days. Computerphile has become one of my favourite channels. Keep on with the good work. Thanks
@voyager_ll
@voyager_ll 8 жыл бұрын
Awesome series. Please make some more on this topic, it's really interesting.
@BattousaiHBr
@BattousaiHBr 10 жыл бұрын
i have to say, being able to learn from an expert about the underlying mechanics of computer graphics is a lot more interesting than one would imagine. hope we can get more videos from him in the future.
@jonathanfox5
@jonathanfox5 10 жыл бұрын
This is a great series! Thank you for the continued uploads.
@QberryShortcake
@QberryShortcake 10 жыл бұрын
I hope you guys keep doing the computer graphics videos, because they're pretty amazing. The Matrix video actually was the first time I actually completely understood the underlying operations I was doing when playing around with OpenGL programming. It'd be pretty awesome if you covered real-time reflections. Screen-Space Ray Tracing and Environment mapping are super interesting, and I'd love to hear your explanations of those.
@osmiumbin
@osmiumbin 10 жыл бұрын
Wish the next video will explain the different lighting types (ambient, point, spotlight, area and volumetric lighting) and how much impact each one has on the rendered scene.
@BigChief014
@BigChief014 10 жыл бұрын
Thank you so much for these videos! You've given us all the foundational knowledge about projecting 3D models to a 2D screen. Certainly enough knowledge to put into words anything else that I might want to research myself. Awesome job John Chapman!
@davidchilds1611
@davidchilds1611 10 жыл бұрын
This was cool. Comparing it to the other videos, while knowing this is just a basic introduction to each idea, really shows how much more complicated lighting is to normal geometric algorithms in graphics. It also gives me added appreciation of when engine developers talk about their amazing light engine (especially in terms of secondary lighting where they have to figure out reflections and the average increase in light in the room). As a budding physics student, I find it really interesting to see how they try an represent this stuff in a computer engine.
@razorborne
@razorborne 10 жыл бұрын
been really enjoying this series.
@shark3D
@shark3D 10 жыл бұрын
CG dude here, interesting to put up a video about light OCCLUSION (shadows) while not putting anything up on how to determine how bright things are in the first place... (gourad shading vs phong vs blinn and so on would make good videos, perhaps the spec component vs diffuse?)
@IgorAherne
@IgorAherne 9 жыл бұрын
John, excellent lesson. You made it so simple - to find out what pixel that given point is, we just need to perform a transformation to "shove" it into the light's z-buffer and see which pixel it will fit there. Wow :D
@geordonworley5618
@geordonworley5618 10 жыл бұрын
This is another amazing video! I am going to soon be making a simple graphics/shading core, and this video provides me with an accurate way to shade shadows (which I have not done before). Shadows wont be built into the hardware, but I will need to have some tricks to write interesting shaders to demonstrate what it can do. I think I will try my hand at shadows.
@Trigger200284
@Trigger200284 10 жыл бұрын
It took a while, but the now they are starting to talk about what the subscribers want to hear. And these videos that discuss virtual worlds really start to hit home how much calculating really needs to happen, and it is mind boggling. I have much more respect for video game developers now
@tiagogomes8530
@tiagogomes8530 10 жыл бұрын
And here we have only seen the visual side which is a small part of a game. Physics simulation can also be pretty calculation heavy and tons of fun.
@Theraot
@Theraot 10 жыл бұрын
I was aware of all the information on this series up to this point. Yet I had always problem when it came to handle lights in 3D scenes, thanks to this video I understand it better, and I think now I have the required information to make it work.
@neoqueto
@neoqueto 10 жыл бұрын
New video with that guy? Gonna keep telling myself that I'm a heterosexual dude again.
@stefanpunt
@stefanpunt 10 жыл бұрын
These videos are actually pretty good, I think it also would be nice to explain to people how ray tracing/path tracing works
@pancakerizer
@pancakerizer 10 жыл бұрын
When you play a game on low shadow settings the shadows usually look really pixilated. Is the shadow quality setting the resolution the image is rendered at for the light source?
@antiHUMANDesigns
@antiHUMANDesigns 10 жыл бұрын
Yep, the size of the "shadow map", that is the depth map that is meant for calculating shadows. Nowadays, we filter the results to create soft edges on the shadows, though. Engines like UE3, for example, even use different resolution shadow maps and blend them together at different distances to create the effect that shadows are softer when they are further from the occluding object, while they are really sharp when they are close. Pretty smart.
@bobnash79
@bobnash79 9 жыл бұрын
I really appreciate this kinds of video... :-) it is now so very clear to me... Thanks computerphile
@dalanxd
@dalanxd 10 жыл бұрын
Fantastic video !!!! Thank you very much Computerphile
@hyperspacey
@hyperspacey 10 жыл бұрын
Fun factoid: because of the computational overhead, back in the day (and still in a lot of games now), you'd build a level with all its lights in it in a level editor/ rendering tool of choice and "bake" the lighting onto the level, ie you'd draw shadows and lighting directly onto "shadow maps", textures which gave the colour and shadow details and were saved off to the level file, and blended onto the level objects at runtime. This obviously had the problem of making files for levels bigger and the amount of RAM needed higher and has a computational overhead for blending two textures, but it saves you doing a lighting pass for every object every frame and you could stick to doing realtime lighting only on the enemies, player, pick-ups and if you were able, throw in a few limited real-time lights to show off.
@ThalesII
@ThalesII 10 жыл бұрын
I could watch these forever
@DudokX
@DudokX 10 жыл бұрын
huray! computerphile has over 198k of subscribers, 200k is just few days away :D
@GaryvanderMerwe
@GaryvanderMerwe 10 жыл бұрын
Please could you do a video on how ray tracing is done.
@thelol1759
@thelol1759 10 жыл бұрын
Stuff like this blows my mind.
@Caparrini81
@Caparrini81 9 жыл бұрын
I loved this series. Very well explain the basis of the 3D CG. I only have one note for this last video, and is, that I happen to be a Lighting Artist of the 3D industry, and I must disagree with the theory of diminishing returns in quality based on the numbers of lights used. Lighting is used to produce a compelling visual result based on art principles, therefore the quality results produced by it, cannot be measure using a mathematical function, and much less just using the number of lights used. Thanks for the videos!
@ashwith
@ashwith 10 жыл бұрын
Thanks for another wonderful video on Computer Graphics! It would be really nice to see some working code - not necessarily the code (I doubt I'd be able to understand it), just what it produces.
@zinggi57
@zinggi57 10 жыл бұрын
I recommand this online curse: www.udacity.com/course/cs291 It goes into EVERYTHING. Shader Programming, animation, lightning, ...
@PutBoy
@PutBoy 10 жыл бұрын
www.shadertoy.com/ Here you can see both the code and what it produces. They are just small examples of shaders, a modern 3d game will contain several of these shaders.
@PhilHibbs
@PhilHibbs 10 жыл бұрын
How do you decide the size and resolution of the light-space depth buffer? If the light is inside the scene, does it have to be a 360 degree spherical projection?
@FoxDren
@FoxDren 10 жыл бұрын
only just saw the close tag at the end of the videos.... nice touch
@ThePharphis
@ThePharphis 10 жыл бұрын
I'm thankful for the ad in this case. Debunking bad science is something more people should be taking seriously, even if it's just promoting those who do it well
@Slarti
@Slarti 10 жыл бұрын
Great explanation!
@GegoXaren
@GegoXaren 10 жыл бұрын
That sort of explains why DarkPlaces once had problems with shadows, sometimes shadows were cast on the wrong side of walls, the devs said it was to do with the z-buffer. It was fixed in subsequent versions.
@coloneldookie7222
@coloneldookie7222 10 жыл бұрын
I love all these Computerphile videos, Brady, and tons of respect to John, but every time I play the video and get visually distracted and just listen to his voice, I can't help but imagine John can do a spot-on Sean Connery impression.
@InsurgentX
@InsurgentX 10 жыл бұрын
Gotta be Connery's long lost nerd son!
@darkangel2139
@darkangel2139 10 жыл бұрын
Awesome video! I would love to see more videos related to web development, and programming in general. I know that so far, there were videos about SQL injection, password protection, XSS, the HTTP protocol, but I would love to see some more topics: - Caching - which is present EVERYWHERE nowadays - Server side vs client side languages or differences between various programming languages - Object oriented programming - Design patterns (although this may be a bit too much for the average computer enthusiast) - Information about various protocols used, like SMTP, FTP, Whois protocol, etc
@Astfresser
@Astfresser 10 жыл бұрын
I really like this series now
@nO_d3N1AL
@nO_d3N1AL 10 жыл бұрын
Great explanation
@kindpotato
@kindpotato 9 жыл бұрын
How on earth can computers do all of this stuff for 2 million pixels 60 times a second with thousands of vertices.
@larsolav
@larsolav 9 жыл бұрын
kindpotato That's why we have GPU's. They have a lot of cores that can do this simultaneously. If you have 1000 pixels to render and 1000 cores on your GPU, you could render all your pixels at once. If this theoretical GPU has a clock frequency of 1GHz it could render 1000 pixels 1 billion times per second.
@AntiGravityC9
@AntiGravityC9 9 жыл бұрын
And then the light bounced..
@Ultimatemau
@Ultimatemau 10 жыл бұрын
Hello! First of all, great video's! I was wondering if you are also going to be including some physically based rendering and maybe some ray tracing vs. rasterization? Are you also going to post a video on the future of computer graphics and maybe some open problems? Cheers
@TechLaboratories
@TechLaboratories 10 жыл бұрын
Fantastic explanation of classic shaders! and thank goodness for the modern GPU that can handle run millions of shaders per second for high frame rate video graphics!
@surrog
@surrog 10 жыл бұрын
To add up, old games used to heavily rely on static shadows : every level, once created, include all shadows create by every static light, so you don't have to calculate these on runtime.
@nathangek
@nathangek 9 жыл бұрын
And imagine, that all this, is happening millions of times a second....
@crahs8
@crahs8 9 жыл бұрын
***** 60 times a second
@nathangek
@nathangek 9 жыл бұрын
Lasse Møldrup Well, I hope you've got more than 60 Pixels on your screen.
@PeterLakeTV
@PeterLakeTV 10 жыл бұрын
Hey Computerphile, I'm wondering if John can show us how to soften shadows using this technique? Regardless, thanks for the awesome videos!
@chevens
@chevens 10 жыл бұрын
interesting topic well explained. Thanks,
@GiulianoConteDrums
@GiulianoConteDrums 10 жыл бұрын
Love this. It relates to video game making (: which I'm interested in! Thanks (:
@Archimagus
@Archimagus 10 жыл бұрын
Great video, thanks.
@HunMASK
@HunMASK 10 жыл бұрын
Great video! Thanks!
@FerroNeoBoron
@FerroNeoBoron 10 жыл бұрын
I hope there will be a video on Ray Tracing. Those kinds of graphics are just amazing.
@purplecoathanger
@purplecoathanger 10 жыл бұрын
I love these videos but it would be really good if someone made a video for this channel that discusses a few different programming languages ... couldn't find any on this channel
@bouldersky2906
@bouldersky2906 10 жыл бұрын
great episode, my only question is how reflected (or refracted) light gets rendered (hint: ray tracing)
@magicstix0r
@magicstix0r 10 жыл бұрын
Are you guys planning videos on deferred shading and/or ambient occlusion?
@Inirit
@Inirit 10 жыл бұрын
There's two things wrong with some of what he said at the end. One, you do not have to go back a decade to see games with only a single shadow map. Many modern games still do this, in fact some still use the trick of an arbitrary light source for a static shadow map throughout the entire scene. Just having the shadow there is enough to satisfy most casual players who don't know to see the missing detail. Also, I'm sure consoles are to thank for the bottleneck of graphical performance. Two, the diminishing return depends on context, but having more than one light source contributing to shadows can provide a lot of detail. Just walking past a torch or something and seeing the shadow bend around it as you move is a very satisfying effect in my opinion. It gives objects in a scene a sense of being physical things, bringing you closer to feeling like you are playing in a world and not an approximation.
@mnementh818
@mnementh818 10 жыл бұрын
I had always wondered why disabling shadows is the best way to make a game run better. Now it makes sense.
@RochesterOliveira
@RochesterOliveira 10 жыл бұрын
Pretty awesome! I wonder how we can deal with the "windows" and translucent objects problem when it comes to light, does it work for multiple objects? How do you deal with light refraction (for example in a glass of water)?
@10DontStopTheMusic01
@10DontStopTheMusic01 10 жыл бұрын
I would guess that it renders the glass as a separate object type, that changes the effect of the light shading output towards things behind it as not complete opaqueness, weather it be refraction, coloring difference, or translucency towards light dimming, so I would make my guess at it being a double render for separate types of objects, as to account for the before understood render problem with glass, as to not render the opaque object behind the glass first, to apply changes
@antiHUMANDesigns
@antiHUMANDesigns 10 жыл бұрын
If you want to render refractions through a perfectly flat surface (no waves), you can render the objects "under" that surface separately, and simply scale them depending on the position of the eye/camera, to create the strange stretching effect that refraction causes. Doesnt' work on uneven surfaces, though. The way refraction tends to be rendered is that you render things to a texture, and then stretch the texture at each vertex based on the normals of the surface on the water. Not really hard to do, in theory. Same principle can be used for reflections on the water surface.
@unvergebeneid
@unvergebeneid 10 жыл бұрын
Transparent objects are comparatively easy because you can specify a minimum opacity to consider an object in the z-buffer. You can't really simulate light refraction without raytracing though. Partially translucent objects are even more difficult since you need subsurface scattering here. It's expensive. And it's surprising how many materials show some kind of translucency and look really really bad if you don't respect that. And water, well water is a whole different sort of nightmare. Raytracing does a pretty good job of simulating how light behaves with a given water surface (like your glass as long as it's just sitting there) but the problem of course is that water is constantly moving and the physics simulations to do that properly are still way too primitive to be convincing. Even most movies that basically have all the time in the world to do their computations, still do a pretty crappy job with CGI water. Pouring is getting there, splashing is slowly somewhat getting there. But putting CG water in a hose and pressing it through a nozzle to get a fine spray? Haha, good one.
@RochesterOliveira
@RochesterOliveira 10 жыл бұрын
***** thanks for the reply and the link! That wiki is pretty awesome, and I think I've got how that solution works now :)
@RochesterOliveira
@RochesterOliveira 10 жыл бұрын
10DontStopTheMusic01 Indeed! this was kind of explained in the previous video, but how it interacts with shadows was a little unclear to me (until I've read all the awesome comments here)
@Mattio_
@Mattio_ 10 жыл бұрын
Awesome video, I am waiting for the day we can do instantaneous Ray Tracing. Gaming will be crazy awesome, and by then probably holograms will be too.
@PacSgt
@PacSgt 10 жыл бұрын
Talk about how to represent orientations in 3D space, and why it is much more complex than at first meeds the eye, next!
@ScottLahteine
@ScottLahteine 10 жыл бұрын
Glad to hear normals mentioned at last. But perhaps they should have been mentioned before now, because they are important in earlier stages. Triangles with normals that face away from the viewer (at least with "solid" objects where the inner surfaces are always occluded) are dropped from the pipeline pretty early in the rendering process.
@druidshmooid
@druidshmooid 10 жыл бұрын
That was talked about at the end of the first video in the series.
@RaKeLN.
@RaKeLN. 10 жыл бұрын
Hello John Chapman!!!
@PhilHibbs
@PhilHibbs 10 жыл бұрын
How do you determine the size of the lightspace depth buffer? If the light is inside the scene, then does it have to be a 360° spherical panoramic rendering of the scene, as against a camera rendering buffer which is a nice neat rectangle?
@giutarmanjosh
@giutarmanjosh 10 жыл бұрын
Is that technique of rendering the scene again to see whats in the shade from ever light source done the same in every engine or are there certain tricks used? Because something like battlefield where lighting is a huge part of it, seems like it would take a ridiculous amount of calculations
@KSITREVS
@KSITREVS 10 жыл бұрын
Ive seen many videos that badly explain path finding, this channel could explain the basics of certain advanced computing algorithms? :) Thanks !
@angeldude101
@angeldude101 10 жыл бұрын
If you look at the pyramid's shadow when it's illuminated, the shadow's edges appear sharp close to the pyramid and get fuzzier the further from the pyramid you go. Does this technique take that into account?
@MrGrahnz
@MrGrahnz 10 жыл бұрын
explain different rendering pipelines please. Forward, deferred etc
@squidcaps4308
@squidcaps4308 10 жыл бұрын
Thank you once again. Lightspace was a new concept to me. I'll keep sharing these in our little group.. Title is a bit misrepresenting, should it be light and shadows? As a word, shade is so close to shaders; i thought it was a typo. PS: Episode about shaders.... Must be next, right?
@Computerphile
@Computerphile 10 жыл бұрын
Thanks for the feedback - name altered slightly :) >Sean
@loremipsumproductivityengi7552
@loremipsumproductivityengi7552 6 жыл бұрын
Which view is what we usually call model view? And how would you combine multiple lighting then?
@EngeKomkommer
@EngeKomkommer 10 жыл бұрын
+1 to get 'bad science'. Really good book. Ben is a pretty funny guy, and I know theres some videos on youtube of him on QI and some talks. :)
@ricodelta1
@ricodelta1 10 жыл бұрын
i want to know if the zbuffer can still render the pixels in a negative value coordinated system?
@TheWeepingCorpse
@TheWeepingCorpse 10 жыл бұрын
The technique he's describing is called shadow mapping , I've just implemented cascaded shadow mapping into my game engine.
@MTimtam
@MTimtam 10 жыл бұрын
If you want to see this computation being executed, try a few programs such as, octane render, arion render, indigo render, lux render, arnold render, maxwell render. And also, shameless plugin, i have over 100+ tutorials of the octane render program that shows how to use it, changing the lighting properties and material properties.
@Chainerlt
@Chainerlt 10 жыл бұрын
Would like to hear how physics in games works and what is particles interaction method.
@Mephistel
@Mephistel 10 жыл бұрын
This explanation makes sense to me when considering the lighting source as pointing in a single direction or forming a cone of light...but what do you do when the light is illuminating a scene 360deg around it, or is emitting from a sphere in all directions (more like a torch than a lamp or flashlight)? Will the z-buffer still help us here, since it's not a viewpoint which can be simplified to a 2d image to compare the pixel depths?
@tiagogomes8530
@tiagogomes8530 10 жыл бұрын
For this case you would usually render the scene 6 times for each light, instead of one. This way you can form a cube around the light and using this information evaluate shadows in all directions.
@Mephistel
@Mephistel 10 жыл бұрын
Thanks for that explanation.
@browncoat697
@browncoat697 10 жыл бұрын
I seriously underestimated the amount of work my graphics card does just for me to be able to ruthlessly rob banks/take over the universe/start a rock band/blow up tanks...
@Tumbolisu
@Tumbolisu 10 жыл бұрын
what about realistic rendering like the "cycles renderer"? it uses some ray tracing things and then stuff and it looks good.
10 жыл бұрын
maybe you could have also mentioned "baking" textures. ( pre-render the scene and adjust the textures and materials to have the lighted texture without using an actual lightsource(in other words non-dynamic lighting) )
@z-beeblebrox
@z-beeblebrox 10 жыл бұрын
Ohh *that's* why they're called Depth Map shadows in 3D programs. I couldn't help but notice that the rendered example was actually using Ray Traced shadows - it started sharp and lost focus as it receded from the pyramid, which Depth Map shadows aren't necessarily able to do :P Is Ray Tracing next, I wonder?
@WarpRulez
@WarpRulez 10 жыл бұрын
It would have been nice if they had presented the other common technique, ie. the shadow polygon technique, and compared the advantages and disadvantages of both. (The depth buffer technique is much easier to implement, tends to be faster, and allows for many very efficient "fake" shadow effects by simply "drawing" onto the shadow buffer. However, this comes at the price of accuracy vs. consumed memory and speed: The more accurate you want the shadows to be, the larger the depth buffer has to be, and the heavier it becomes to populate. With smaller depth buffers you get visible pixelation of the the shadows, and these artifacts become larger the farther the shadowed surface is from the light source. The shadow polygon technique is more complex to implement and can be less efficient, depending on the geometry. They are also harder to use for "fake" shadow effects. However, on the plus side all shadows will always be perfect, regardless of distance, and without the need to increase memory consumption for more accurate results.)
@WarpRulez
@WarpRulez 10 жыл бұрын
***** Given that shadow maps give a binary answer ("is this point in space closer to the light source than this another point in space?"), how exactly does it allow making soft shadows?
@WarpRulez
@WarpRulez 10 жыл бұрын
***** I don't get it. Shadow maps only give a binary test (ie. "is this point lighted by this light source or not?"). It doesn't give a percentage of how much the light source is covered. (The technique is explained in this very video.) Using lower-resolution maps isn't going to soften the edges of shadows, it's only going to make them look pixellated (ie they will have visibly jagged edges.) You can't "blur" the shadow maps because it's not like they are projected onto the scene; they are used for the test (that gives a binary answer). I don't understand how you could get soft shadows with the shadow mapping technique (or with the shadow polygon technique for that matter.)
@WarpRulez
@WarpRulez 10 жыл бұрын
***** "By taking a lower-resolution shadow map and interpolating it with a higher-resolution map you can fake a penumbra blur, so if the lower resolution says a fragment is out of shadow but the higher resolution claims it is within shadow then you can start guessing that the area is question is suitable for blurring and creating a penumbra, a softer shadow." I still don't understand how that can work in any sensible manner. It just sounds like sometimes the two maps will coincide, and sometimes they won't (after all, one's just a low-resolution version of the other, so it depends on which part you are sampling if the "edges" of shadows will exactly coincide or not), and sometimes you will get swapped answers (is in shadow in hi-res and not in low-res, or vice-versa) so even if you do this, you will get some parts of the shadow's edge that are sharp, and some that you have blurred with some heuristic, resulting in an unevenly blurred shadow. Also, it doesn't sound like you could easily calculate _how much_ the shadow should be blurred at any given point (ie. in practice how much the light source is covered by the obstructing object.) At most it sounds like you can make a (rather inaccurate) guess that the current fragment is close to the shadow's edge, and then just change its brightness... by some arbitrary value that doesn't really correspond to anything.
@thegamingruler1996
@thegamingruler1996 10 жыл бұрын
WarpRulez it takes into account the area of the light source, the bigger the area the softer the shadow because the shadow of the object has a lot more light influencing its opacity (softness)
@WarpRulez
@WarpRulez 10 жыл бұрын
THEGAMINGRULER _What_ takes it into account? (And how?)
@MissPiggyM976
@MissPiggyM976 8 жыл бұрын
Very good series, but camera buffer and light buffer can't record the depth of the same world points, so a point nearer the camera can be wrongly occluded by an adjacent point nearer the light, especially if they belong to the same object. Precision is an issue.
@LittleGreenFire
@LittleGreenFire 10 жыл бұрын
So does that mean that adding a light to scene that casts shadows effectively doubles the time it takes to render the scene? Since you have to look at each triangle twice to render two scenes.
@Computerphile
@Computerphile 10 жыл бұрын
well, adding lights and shadows to the 'standard' computerphile graphics certainly took a heck of a lot longer to make this film! - more than twice as long to render each graphic >Sean
@gummipalle
@gummipalle 10 жыл бұрын
Well, lights only effect a limited radius/angle... areas that are not visible in your view-port are not processed... You can use foreground objects to conceal missing / cheap shadows... I think most game machines would have a harder time managing more screens/view ports, than more lights...
@JakeCakeful
@JakeCakeful 10 жыл бұрын
In a way it can, but the bottleneck of modern graphics is rarely the amount of triangles being drawn, but rather the amount of data being sent back and forth the PCI-BUS and other places.Sso rendering the exact same scene twice without having to switch anything around in the ram is much faster than rendering two separate frames where stuff has moved around etc. Also, the light scene only needs to render to the depth-buffer, not to the color buffer and so on, so the shader is much simpler. In addition, unless you turn shadows to ultra-settings in some games, the shadow buffer is not going to be the same resolution as the standard pixel-buffer as the visual differences are minuscule, so reducing it to 1024*1024 instead of full HD 1920*1080 of a screen will make it render many times faster as well. My guess is you can render something like 5-10 decent quality lights before you reach half the frame-rate of having none.
@osmiumbin
@osmiumbin 10 жыл бұрын
My assumption is that it doesn't take twice as much since it's not another camera object (not another viewport), but a light source. Another thing would be that the light might have a certain reach distance so it will not render shadow for far meshes. That being said, i think the time cost for adding a light could be smaller than 1.5x.
@osmiumbin
@osmiumbin 10 жыл бұрын
Илья Найдов Yeah, but i wasn't talking about rendering the video. I was refering to an ingame scene.
@builderk
@builderk 10 жыл бұрын
I would like to request a video on the perspective division.
@ArnimSommer
@ArnimSommer 10 жыл бұрын
So, when will you get to radiosity?
@adamlovelace7572
@adamlovelace7572 10 жыл бұрын
The different frames wouldn't have each pixel matching up one for one. I'm guessing there would be an algorithm for figuring where pixels in the camera's frame are in the light's frame.
@PanadeEdu
@PanadeEdu 10 жыл бұрын
I miss a bit the Raytracing effect on Light interactions. Its quite important nowadays, because the speed of modern Computers allow simple (not too deep) raytracing. Also it's verry Simple to Explain. :) Also I would have explained the Propertys of Objects first, to show what effect the Lightlevel according to the angle can have to a Face. But I guess the topic Shading is in the pipe.
@willlewis77
@willlewis77 10 жыл бұрын
Can you do a video on ray tracing?
@4onen
@4onen 10 жыл бұрын
This is pretty neat, but wouldn't it be more efficient to raycast from the point being rendered to every light point in the scene? I'm just asking because as far as I knew prior to this video that's how it worked.
@RomanNardone
@RomanNardone 10 жыл бұрын
I'm curious to see how a shadow is displayed when it is not a clear 1 or 0, but rather has a large shade of values it can be. I have seen a shadow in games that is all the same hue, but how can you create dynamic lighting system that can be lighter or darker?
@shark3D
@shark3D 10 жыл бұрын
Since in this technique a shadow is ALWAYS a grey value (distance, but from the light) the blurring has to be done intelligently by algorithms) what usually causes a shadow to appear "blurry" is actually the size of the lightsource, for example a small point far away light (the sun, small flashlight) casts a sharp shadow, while a large source of light (window opening to a bright sky) casts very blurry shadows... it actually casts an infinite amount of sharp shadows from every possible point in the window :) which should let you in on some ways games use to possibly draw such a shadow (there are a few ways to draw blurred shadows)
@SapphireCrook
@SapphireCrook 10 жыл бұрын
And my computer does this 60 times every second when playing a game? Amazing... So many little beeps and boops. Like little ants. Also, it's natural that 0>1 shadows is so much better than 1>2. After all, I don't think you can pinpoint the relative increase from 0 to 1, while you can easily say 1 to 2 is a 100% improvement over the original.
@antiHUMANDesigns
@antiHUMANDesigns 10 жыл бұрын
It's even worse, they pretty much run a small program for each pixel, to calculate normal maps, specular maps, and in some games even displacement maps. (CryEngine, for example.) It's crazy. It's not strange that a gfx card costs as much as all the other parts of a computer combined, and uses more power than the rest of the computer. :P
@MasterHigure
@MasterHigure 10 жыл бұрын
So... Of all these things (transfer from local space to view space, calculating pixels, and shading) which are usually handled by the CPU and which are handled by the GPU?
@tiagogomes8530
@tiagogomes8530 10 жыл бұрын
The basics are all done by the GPU ( vertex transformation, lighting, rasterization, etc ), which is good as it's orders of magnitude faster than a CPU for this things. You only start doing computations at CPU side we using some advance techniques, and even then you usually try to push as much of the calculation as you can to the GPU.
@KajoFox
@KajoFox 10 жыл бұрын
What about LOD management and Mipmaps?
@realraven2000
@realraven2000 10 жыл бұрын
Could you make a video on the difference between static and dynamic lighting. Anybody remember descent2 and the flats you could fire?
@MEATLOAF2able
@MEATLOAF2able 10 жыл бұрын
I think baked lighting is essentially just the lighting information calculated first, then either saved to the original textures it is cast on, or a combination of the original textures and a "lightmap". Basically it's like doing the lighting calculation ahead of time, and saving it for later use, so you don't have to calculate it every frame at runtime. Although it's static and the light can't move, or effect objects moving through it. I don't think there are any differences in the actual processing of the light.
@mattlm64
@mattlm64 10 жыл бұрын
I suppose many games use pre-rendered shadows for static objects, and only render shadows in real time for objects that move?
@LimeGreenTeknii
@LimeGreenTeknii 10 жыл бұрын
I know in some more modern games, like Pac-Man Party and Beyond: Two Souls, I've seen some shadows that looked really blocky, as if 9 or 16 pixels were 1 pixel instead. They seem very out of place when the rest of the lighting looks just fine and the shapes of the characters look great. Why is that so?
@tiagogomes8530
@tiagogomes8530 10 жыл бұрын
The are probably lowering the resolution of the "image" rendered from the light's point of view to save time, this way you get more blocky shadows. It's also worth noting that this method, as explained here, has shadows that get more pixelated as it get further away from the light source. This happens because objects far away become way too small when seen by the light, giving less precision to the shadow.
@ThomasKole
@ThomasKole 10 жыл бұрын
But how is then determined which point of an object from the light's POV corresponds with which point from the camera's POV?
@IceMetalPunk
@IceMetalPunk 10 жыл бұрын
It's just a projection, the same technique he described in an earlier video to project points from object space to world space. Only this is from view space to light space.
@Watupm
@Watupm 10 жыл бұрын
I'd love to know how you render moving water, do a video? :D
How Ray Tracing Works - Computerphile
20:23
Computerphile
Рет қаралды 52 М.
The Visibility Problem - Computerphile
7:58
Computerphile
Рет қаралды 159 М.
Маленькая и средняя фанта
00:56
Multi DO Smile Russian
Рет қаралды 2,9 МЛН
Follow @karina-kola please 🙏🥺
00:21
Andrey Grechka
Рет қаралды 13 МЛН
The Font Magicians - Computerphile
19:31
Computerphile
Рет қаралды 365 М.
How AI 'Understands' Images (CLIP) - Computerphile
18:05
Computerphile
Рет қаралды 133 М.
Interactive Graphics 15 - Lights & Shadows
1:08:29
Cem Yuksel
Рет қаралды 4,6 М.
Has Generative AI Already Peaked? - Computerphile
12:48
Computerphile
Рет қаралды 503 М.
Triangles to Pixels - Computerphile
8:17
Computerphile
Рет қаралды 228 М.
Error Correction - Computerphile
11:30
Computerphile
Рет қаралды 246 М.
3D Gaussian Splatting! - Computerphile
17:40
Computerphile
Рет қаралды 99 М.
The Great 202 Jailbreak - Computerphile
19:55
Computerphile
Рет қаралды 517 М.
Basic Shadow Mapping // Intermediate OpenGL Series
16:54
OGLDEV
Рет қаралды 18 М.
Typesetters in the '80s - Computerphile
12:23
Computerphile
Рет қаралды 100 М.