 Ieithaf, mae'n amlwg. Rwy'n cael casodd o'r ddechrau drwy'n cefnogi. Bwy oedd e'n nhw'n eu cyflewnol. A i fewn ni wedi'u ffordd y gwirionedd ac pefnogaeth ymlaen. Felly, mae'r ddaf yn ei gwirionedd a'r programei yn rhan fwyaf. Mae'r am surelyd, yn 80a sydd gyda'r prosgram byddai i'r amlwg byddwch. ac dyma'r awgngoedd yma i gyd mewn orgau ymweld i'ch cymdeithasol i ddechreu a chi'n gweithio'r llwybraid i'u cyldogon. Ac mae'n dweud am eich prydau ar gyfer odd i fod yn ymryd ar maeniau yn ysgrifwyr. Ond yn ddiwedd gan ymddangos, hi'n gweithio cwestiwch gweld y proddoriaeth perddwyr. Vitiais o'r sefydliodd y torni, ac odu stan gweld ymryd a'r ei ganuaeth. Mae'r gallu gweithio'r cyllid ynynol, oedd hynny'n gweithio'r llwybraid. fel ei mod einembre democrat providing introduction on the other days in it, then talk about okay, then how do you do it in closure And I've got an open source library and I'll explain a bit about what that can do in there, hopefully do a bit of light coding at the end o much time I have roughly? an hour fantastic okay we can do lots enjoying its all the code and the questions and stuff like that an actually digging into a bit to the detail of how it worksolydd. Y geneslaid plurwag i gyrwyddiant. Felly mae'r gyrwyddiant ffordd yna, mae'n bwyllt cyfan hwyl wedi hynny o neud oherwydd ar y ddweud y llwyddiad o hynny o'r teulu arno gwahanol y Llywodraeth'r Taflwyr. Felly oedd yn ymdryghu'rному am fyddion gyrwyddiant, arno'r codw iawn. A, dyna, yna bod ymwynghwynes arlau yr ysgol o'r newydd pan fyddion gyrwyddiant, i wnaethe'n cael gwirio ddydd o phryddiant. A os gen i'n geralwch gwybod yn llunio. One of the things is actually creating textures. So the kind of textures you seem in computer games, often they are generated with some of these kind of techniques. You can do it for abstract art, just creating things that look beautiful. You can do it with music, so the stuff you apply to graphics can also create sound and there has been a lot of progress recently in actually creating reasonable sounding music from some of these techniques. Mae'n gwybod i'ch gwaith gweithwyr, felly y clywed o'r gwahanol clasig yw'r gennaeth yn credu gwasanaethau. Felly, mae'n gwybod i'ch gwasanaethau gwasanaethau yn y dynion gyngor, gwasanaethau roglwau. Felly, mae'n gwybod i'ch gwasanaethau yn credu o'r gwasanaethau yw'r gwasanaethau. Mae'n gwasanaethau, oherwydd, o'r gwasanaethau o'r gwasanaethau, oedden nhw'n gweithgwyrnol gyngor, o'i gwasanaethau o'r gwasanaethau i gaelwys. Ond y gwirionedd eich cyfnodd yn cael ei gweithio allan o'r content. So, mae'r rhaid i'n ffrindio iawn i gweithio allan o'r fly o'r cyflwyno ar y cyflwyno cyflwyno ar y systemau cyflwyno. mae'r cyflwyno yn fwy o'r fath rwyf wedi'u cyflwyno o'r wlad sy'n fudio mynd i'r ysgrifennu'r gweithio. Ond hynny'n gweithio am y cyflwyno am y gweithio. We'll generate some images and the 2D images. Go On выog y gwasanaeth y next axis a y y Y axis. The task is to solve the problem of what colour are we going to put in each energy pixel. For every single point we generate a colour, red green blue etc. If we do that for each pixel, then we'll end up with some kind of image. We'll hopefully another intelligent image so we'll get a nice image that we like. The key idea here is if you want to make a more interesting image you have to combine different things together. One of the concepts here is the idea of composition. The exact same way that you are in a functional programming language you are going to compose functions we can actually think what happens if we combine images? So if you have a function that produces the image on the left and a function that produces the image on the right fydd yn gwahanol ar gyfeddwyr, ein cyfnod o'r holl, yn ôl bod dylai. Felly, dylai'r gwahanol yn gwahanol yn gweithio'r fath eich wath, bydd y fath erbyn yn gweithio hynny mae'n gwahanol yn gweithio'r Saroedd bryd, y bydd yw'r gwahanol yn gweithio'r fath eich gwahanol yn gweithio'r holl rydych chi'n gwerthu. Rydych chi'n cyfaint o'r ddau yw, yr hynny'n cyfanaeth o'r mynd yn gwahanol, leoedd y gydag, mae e'n gwahanol'r teulu. Wrth fy mod i gynnwys'r ysgolwys a'r gwscaniaethol hynny. Wrth fy mod i'r hyn ymgwrs yll interim y Wrath Llywodraeth. Pei'r cydweithio gyda'r gyflosiaeth sydd gyda'r cydweithio gyfo yw am gyda'r cydweithio, neu wedi'i gondol i fy nghymru i gael i gael ei ddarloed a yna'r cyntaf, mae'n ddysgu gau'r gyflosiaeth ymgwrs ymgrwy Waters, ac mae gennych yn dw i'r cyfrydwyr yma, surfaces are the neis example of this is a guy called Roger Allen, took this this library and turned it into a Twitter bot called twigie me and it creates all of these weird and fantastic images, and it does it not by any sort of manual process, but by genetic algorithms. So the images almost get bred together turns out actually that's quite easy doing collection so if you're a man you go Yn cael bod ei ddweud yn gweld i wych. Felly, y gallwn i ddim yn agorlau'r cymdeithas, eich ffórm, gyda'r ddiwrnod o ffwrdd, mae'n cael bod yn gweld i gael y cymdeithas cymdeithas. A ddau'r ddweud o gyfnod genedlau�au i'r ddweud o'r ddweud o'i ddwyngu gan y llwy, ac mae'r ddweud o'r ddweud o'r ddweud o'r ddweud o poblu. Yn cael bod e bwysig i'w ddweud o'r ddweud, ymwneud, mwyn Twigemee maith arle i yw'r frysg, a i'w gynedd y drafod yn Fatham Y Llyfrgell. Felly dyw'r ddweud, mae'r dŵn, gwylwch wedi bod yn y gwirmogol eich cyflau o twigemee. Mae'n ei wneud i'r hwn o'r holl ddweud o erond o'r mwybred, felly mae'r 1000-x 1000 o'r ddiweddyn nhw. mae'n meddwl o'ch cyntaf o gymliadau, mae'n meddwl o'r cyntaf o ffathau hynny. Bydd ymchwil rhaid, mae'n meddwl o arwain o pattern. Mae'n halu peirio o'r cwpwy o'r maen nhw. Bydd yma mae'n meddwl o roeddiogl ymbrerfa cyllid, bydd yma mae'n meddwl o crawlid yn cometarnol i'r ystyried. Mae'n meddwl o'r llon, fyddwch i'w gyntaf yn anhraff. Bydd hyn sylwedd yn éw lwych a'r tybl yn gweld llyfrhysydd, another one of these algorithms that does, that evolves and it creates some different kinds of images. So they both sort of find different kinds of concepts. Say just an example of the kind of things you can do with this. Of course you can also manually craft these syntax trees if you're trying to create a particular kind of effect and we'll do a bit of that later. First of all, I always think that when you're working on these kind of things, building these kind of libraries, you want to make the basic interface to get something up and running really, really simple. So we just have a show command at the repel and you say I want to show some tree, some definition of an image. One of the simplest things you can possibly do is something like show x00. So I just want to stop and quickly explain the syntax so that the other examples become clear. This is basically the definition of the image generator. What we're saying is there's three channels, red, green and blue, to create the image. And we want the first channel to be x, the second channel to be 0, and the third channel to be 0. So red is going to be defined by x, green and blue are both going to be 0. When that translates into the image, x is varying from 0 to 1, y is varying from 0 to 1. So as x increases, you increase the amount of red. Y doesn't appear in the image definition, so you don't get any variation going down the y-axis. It's just a constant gradient. Make sense? So obviously, you can put in a green channel. So if you put y as the green channel, then now you're getting variation along the y-axis and the green comes in this way. Obviously, you go this way, you combine red and green, so you get yellow. So a couple of points is these sort of clysg functions, these definitions, are actually generating something like an AST. When clysg actually generates images, what it's doing is it's almost like a little compiler. It's taking these ASTs and it's turning it into some more efficient closure code. The actual code looks something like this. It's doing do times y for the height of the image, so it's looping from 0 to y, do times x for the width, so it's looping across that. Then it's creating a bunch of code, so doing some code generation that actually is the code that calculates the color for any given x and y. Then it's effectively doing a set RGB on a Java buffered image, so you actually get the pixel set in the image. Closure is actually great for this because it does make this pretty simple process to work. One of the challenges, of course, is making it efficient. We can talk a bit more about that later. One of the things clysg does is it has a bunch of different primitives, which are the things you can actually use to mix in and create the image. If you just set constant colors, 0.1, 0.7, 1.0, you'll get a nice blue and it's a constant color. If you've got no x's and y's appearing in the formula, it's just going to be flat. There's a few primitives which are designed to just be commonly used. Stuff like checker, if you want to check a board pattern. You can do texture maps, so if you've got any image you want to load in, that's just a closure logo. You can import those and use that kind of thing. It gets more interesting when you look at some of the transformations you can apply to these primitives. For example, scaling. You can have a checker board with just red and pink. If I scale it by 0.3, it's going to shrink that checker board so you get more of the checkers in the space of the image. This is like a higher order function. The scale is transforming whatever else you put inside it and giving you the ability to compose these primitives together. You can also do offsets, which is just shifting the image to the side or up or down. The more interesting one is warps. Instead of simply doing an offset or a scale or one of these simple transformations, you can say, actually I want to take one function and use it to change the X and Y coordinates that are being used. I have trouble getting my head around this all the time. Instead of using the X and Y on the image, you're going to put that X and Y through another transformation and then use that in the other generator. This is probably the most powerful of the compositions. What it's saying in this case is, I want to start with a checker of red and pink, but then I'm going to warp the X's and Y's around. As you can see, you're getting red and pink from all different angles. It's transforming the space. I call it warp because it's warping space, space-time, if you like. One of the other helpful things is, often when you try to create textures, you want things to look a little bit realistic. Realistic textures have randomness in them. If you think about tree bark or the texture of stone or clouds, these kinds of things. Some of the most important tools to do that is this idea of noise. There's these noise functions. We have monochromatic noise. It looks like a slightly blurry picture of dots. It's got bright spots and dark spots. These are pseudo-random. The reason you want pseudo-random is if you just put totally random, you get a mess of different colours. You want randomness, but you want it to move smoothly so that you don't get these sudden jumps and you'll look like white noise on a broken TV if you have complete randomness. The other reason it's pseudo-random is you want to be able to repeat this. Imagine if you're doing an animation, it's no good if the dots come in completely different places every time because it'll make the animation look like it's just like... I should have done a video, but you'd get this effect of the animation flashing around and nothing ever being in the right place. If you want things to animate smoothly, you have to use pseudo-random noise that has these smooth gradient functions. You've got the monochromatic noise. You've got vector noise, which is just the same kind of noise function but in the red, green and blue channels simultaneously. You also get these interesting... I love these ones called plasmas. The plasmas are actually fractal noise. It's the same effect as if you took the monochromatic noise. You have a big wave of noise. You add to that a higher frequency noise with closer together peaks and you add a much more high frequency noise. You add a few of these layers together, five or six levels of it, and you get this cloudy plasma effect, which is very nice for certain kinds of textures, particularly natural textures because a lot of nature has these fractal properties. I actually wanted to go to do some live coding. I'll just show you a couple of the... Let's go, let's go, let's go coding. Hopefully this all works. It's technology, so I can't always go on to it. Does that look okay? Can people see that? It's quite hard to make eclips have big enough text and also be able to be visible. This is a sample namespace. I'll just run through some examples and we can play with the examples. If you want to try things out, let's make this interactive. Just say, hey, can you do X and then we'll see how it works. Let's start with the most simple thing. If we just want to show a single colour, we have show 100. What's that going to be? Red? Correct. It's going to be flat red. That's a bit simple. Let's say we... The next one is... As we think about these vectors of red, green and blue, you can also have scalars. A scalar is just a normal number. The way I've done it is a bit weakly typed here in the sense that you can either have a vector or a scalar as an argument. If you put in a scalar as an argument on its own, if I say it just says show 0.5, it interprets that for every channel. So red, green and blue all get 0.5 assigned. See a nice grey? Which is exactly the same of course as separating it out separately, but it's a shorthand for doing that. We have named colours. You can show pink. Utility functions for people who are being creative with this. We put in the variables. That's the one we had earlier, just having an xy nought. Let's just have a play with this one then. Let's do v star, 3x. So I multiplied it by 3 here. So x is now, instead of going from 0 to 1, is going from 0 to 3. This shows you what happens when one of the channels caps. It actually just truncates at 1. We can't currently display colours brighter than 1. Anyway, that's the first third of the screen. Here it's going up to 3, but it's just truncated, clamped at a value of 1. It's just the same with green. This is how you do the addition. We're getting now into the first combinators. I called them v plus v star to avoid the name clash, because you actually want to use star and plus when you're actually doing calculations. So I had to give them a different name in order to make this work logically. Plus would have been the one I'd have used if it weren't for that. Plus, I've added together the x and y gradients to get this image, which is, of course, the same as just showing x, y, 0. No need to do that. Multiplication. So, again, the same thing. If you multiply these, scale these things up, you're going to get the truncation happening. So let's get into actually what these things are. We're actually creating these things called nodes, which are the AST nodes, which produce these images. So let's say we say, okay, instead of showing, I'm just going to actually generate a node with x, y and 0. So x, y and 0, here is just a closure vector, but we need to turn it into an AST. So if I do node x, y, 0, I get this little data structure. This type is a vector, so it's recognised that it's going to have multiple channels. The other type would be a scalar, if it's just a single number. The code for each of the things is just x, y and 0, which is taken out of the vector. Objects is nil, and it's, importantly, and this is important for performance, it's analysed it and said it's not constant. A constant would be if it was 1, 2, 3 or something like that, but because you've got an x and y in there, it's going to say it's not constant. This is important later, because some operations are going to get much faster if you can realise that they're constant and don't try and recalculate them for every pixel. The objects is a bit of an internal implantation detail, but in closure you can't easily pass around binary objects in forms. I found out that a lot of various things behave slightly weirdly. If you were to put in something like a buffered image, it stores it in here, in this objects field, which can then get passed down the AST, so at the root of the AST you might have 10 different buffered images that you're combining. This is like a set of objects that gets accumulated. In this case we don't have it. What it then does is let's say we have that same node. There's a little code generator. Let me just run this one. I'm going to run code gen on that node. What it's generated is a let statement. This is something I actually need to tidy up still. It's generating some temporary variables, because sometimes you're generating many different Xs and many different Ys in different parts of the formula, so you have to make sure they don't clash. It's creating a let statement, and at this point it's setting Z to 0, because we didn't want any Z. It's setting X to the X temporary variable and Y to the Y temporary variable and Z to the Z temporary variable and then in this case not necessary. Then it's calling a little function called 2ARGB, which is taking the three double values. Everything's done in doubles internally, floating point, and it's converting that into an ARGB encoded int effectively, which is what you need to put into the buffered image. This basically gets inserted inside a loop and then when you're actually doing the rendering. This is the actual code that gets put in. From a performance perspective, if you want this to perform well, all of the Xs, all of the Ys need to be double floating point. If you start doing that with objects, using the regular plus minus star on objects, and closure then has to do dynamic analysis of what kind of object it is, it has to do the type analysis whenever you use the standard closure.core plus. You want to keep it in doubles so that this actually gets compiled down into the actual JVM efficient bytecode. It still works in fact, but it will go 10 to 20 times slower if you don't manage to get everything into doubles. Slightly more complicated one. In this one, for example, you can see how it's converted the V star, which was the vector multiplication. It's actually converted that into two separate closure.core multiplications, one for each channel. Part of the job of the AST nodes is to know which underlying functions in closure or there's a few custom functions you actually want to translate the code into. I've got some predefined patterns. It doesn't help if I don't include both brackets. The checker pattern, this kind of thing. Is this making or making sense to everyone? If you want to try anything, by the way, do shout out, we can check a black-white. This is nice. This is looking at function composition. Checker isn't just for two colours. You can use it for any other arbitrary, any other node, any other generator. Here, instead of doing a checker with two colours, we're going to put a smaller checker inside a bigger checker. You get something like this. That's just an example of offsetting the same thing. Offsets are one of these functions you can use. This is interesting. It's applying the same principle. Anywhere in Clisk you can use a number. You can also use an x or a y or another function. Here, for our offset, we're not just going to use a constant offset, which has the effect of shifting up and down. We're going to offset by 0.3 times y on the x-axis and 0 on the y-axis. The same thing. This has an effect of adding a skew. As you go down the screen, you're increasing the x offset. Let me just see if this works. Can anyone remember how to do a rotation? This is like stretching my brain going back to all of my matrix geometry. I think you do a minus of the same thing. This might not work. If you apply your geometry to this, you can start getting all kinds of different effects. I'm trying really hard to break it. I'm going to see if I can put a bit of animation on this. Animation, we basically want to make sure that we're changing some of the variables as you go on. In this case, we'll have a variable like an i, which is going to increase from 0 to 100. We're going to want to change these numbers. The 0.3 and the minus 0.3. I think it's going to be something like sin i times 0.05 i. It's something like minus sin times 0.05 i. Live coding, I've never done this before, so I've got no idea what it's going to do. It's probably math sign, isn't it? Anyone remember if closure imports math by default? It's got a bit of flicker because it's not designed for real-time animation, really. You can see it's pretty fast. Each of those was basically an entire frame rendering. You can actually create little animations with this as well. Of course, you can use your sine waves. There's actually a vector sine function in the v-sine, which is a sine node, which creates sine waves in the thing. Oh, sorry. That's just defining it. This is an example of using closure to plug and play these components. That's defining a thing called a sine wave. Maybe we can show it. Show sine wave. I think it's just very dark. That's too big. I'm not quite sure why, but it's very dark. I could just see on my screen a very slight variation in the grey. That's one of the things you run into quite a few times when you're experimenting with this. Sometimes the colours are either too dark or too bright and it saturates. Your scaling is way too big and the entire thing gets squashed to some things. You have to experiment a bit with the scales. That's a sine wave. You're getting a hump effect. It's going negative at these points, so it's just being truncated to black. You can then use that sine wave as a building block for your other patterns. In this case, it's using sine wave for an offset. It's using sine waves as an offset for a checker pattern. Anyone got a guess on what it's going to look like? A wave you want like that? It's the sine wave. Instead of using the sine wave to generate a colour, as we just showed it before, we're using the sine wave to generate the offset. This is one of the examples of variable offsets. This is a very useful feature. One of the things about the red, green and blue concept of colours and channels is that it's great for computers. That's what needs to get pumped out to the display. It's very easy to do maths with it because it almost follows linear logic. The problem is that's not actually very good for artists. Artists hate RGB colours because they're not how people perceive and think about colour in general. A much more intuitive way is to use a different colour space like hue, saturation and lightness. Clistic has got a whole bunch of different functions which convert between different colour spaces. If you were to generate a pattern in the hue, saturation and lightness space and then convert it to RGB, you get some quite different effects. This is RGB from HSL. It's taking HSL and turning it into RGB. The HSL is doing X, Y and 0.5. When you convert it into RGB, you get this. That is basically the hue dimension increasing. You're basically going around a colour wheel. 0 to 1 is basically the same as going one circuit of the colour wheel. Going from the bottom to the top, that's the saturation. You're going from fully saturated... No, that's fully saturated. I forget which it is. One of them is fully saturated. You're going from grey, which I think is fully saturated. Who knows? You're going from grey to pure colour as you go from the top to the bottom of the screen. If you want to do it with lightness instead... Instead of changing the saturation with the Y... Let's keep the saturation at 1, I guess. We can put the Y in there. Now we get the lightness varying. You're going from black, which is 0 lightness... ...to pure colour, which is 0.5 lightness... ...to white, which is 100% lightness. Textures. Here's a picture of a cannon I took in Malacca. That's just a regular image. You can just import whatever you want. You can do anything you can do with any of the other functions. You can do it with images as well. Here's an example. It's a hue adjustment. What we're going to do is adjust the hue, saturation and lightness... ...using the X coordinate. Any guesses on what that one looks like? Here we go. You get a rainbow cannon. What's happening here is... ...as you go along the X axis... ...it is shifting the hue... ...and you get this kind of effect. I'll show you how easy it is to create your own higher order functions. Let's say you wanted... ...this one's a flip. I call it a flip. It's a regular closure function. It's going to take one parameter, which is a node... ...and it's going to warp that node. The warp is going to change the Y to an X... ...and then the X to a Y. If it was X, Y here, it wouldn't do anything at all... ...because it's just using X as X and Y as Y. Here it's saying I want to use Y for the X... ...and X for the Y. What that's going to do... ...helps if you define your functions before using them. It's going to swap the X and Y axis effectively. Any kind of transformation you want to do... ...you can define as a regular closure function. Some noise. I showed some noise patterns earlier. That's just a regular sort of noise. You can do lots of fun stuff with noise. That's the vector noise. If you imagine that this is going from zero to one... ...in a smooth pattern... ...sometimes you want patches of noise. Let's say you're doing something like tree bark... ...with little patches of moss. You can use the noise function to create that kind of thing. You often want it not to be positive in all places. You could do something like... ...you could subtract from it. It'll go down and hit zero. If I just take away 0.5 from the noise... ...you're just going to get these little patches... ...because I've basically reduced the noise... ...and every way it's dropping below zero... ...it's just disappearing and turning into black. You can obviously combine it with images... ...and stuff like that. Here you can use the... ...that's the vector noise... ...so the coloured noise... ...and overlaying it on the cannon. I'll show if you take noise... ...and really scale it out. Why didn't that work? If you really scale out noise... ...it starts to look more like just completely random noise... ...and it gets something like a TV screen thing. The plasma noise, the fractal noise... ...is sort of like this kind of thing. You can sort of see the fractal effect... ...slightly here. You've got these sort of light patches. Remember I said how you're adding together noise... ...of different wavelengths? The big wavelength noise... ...is probably causing this light patch here... ...this light patch here... ...and the dark patch here. The smaller wavelength noise... ...is what's creating these smaller perturbations... ...in the colour. Noise is interesting... ...because you can use it for lots of different things. You can use it for offsets. If you use noise as an offset... ...you get this sort of effect of like... ...I think it's like looking through wet glass... ...or something like that. It's distorting the image differently at different points... ...which is the kind of effect optically you'd get... ...if you had water of different depths... ...causing different refractions. A fun thing you can do with this... ...and it's a slightly more complicated example... ...is you can use it to create landscapes. So these kind of plasma based noise... ...is actually very similar to the... ...height contours you typically see in landscapes. So if you take that principle... ...and you say we're going to build... ...a height contour... ...you can actually create these sort of... ...factor landscape-type things. Yep, bit slow that one. So it's a slightly more complicated example. What we're actually using is... ...we're using the noise, the plasma noise... ...as a height map. So these will be like the highest points... ...the little snow-capped mountains. Whenever the noise is going below... ...0.5... ...or the midpoint... ...we're sort of saying that's going to be C. So we're colouring it to a shade of blue. And it's actually using a map of different colours. So rather than saying I just want to go from... ...black to red... ...or sort of a very algorithmically designed thing... ...actually I chose these colours... ...and I said I'm going to have a colour spectrum... ...which goes from a dark... ...very dark blue... ...to a lighter blue... ...then it suddenly jumps to a yellow... ...for a very small amount... ...to give you sort of slight beach effect. Then you get for a longer period... ...it's some shades of green... ...then it goes into some browns... ...and ultimately white for your sort of snow caps. So this is where you start combining... ...the algorithm... ...a variety of judgement on... ...how much of different colours do you want... ...how do you actually want the thing to come up. So it's a great prototyping tool... ...if you're just trying to... ...quickly try out different things... ...like... ...let's say Landscape Map Z... ...colours... ...colours... ...sunset map... ...ok... ...bright colourful map... ...desert map... ...that's the Landscape Map... ...so it's saying... ...I want a colour map... ...zero is going to... ...0.5 is a dark... ...starkish blue... ...0.3 is going to... ...0.8 is a bit of a lighter blue... ...so those basically are the colours... ...that that landscape... ...does... ...but let's say we can have... ...a desert map instead if we like... ...it's a bit slow... ...that's a different colour map... ...you can play around with these things... ...and get different effects coming out... ...another nice thing with these plasmas... ...if you use... ...plasmas... ...so there it was... ...one other thing I should say about this one... ...there is... ...it says render lit... ...like for rendering... ...for the shadows... ...you saw the mountain look... ...you can see how it sort of slightly looks like... ...it's got shadows on this... ...so you can sort of see the dark side of the mountain... ...and the light side of the mountain... ...this is not a renderer... ...it is not remotely capable... ...of doing... ...lighting calculations or anything like that... ...it's not a ray tracer... ...so... ...how is it actually creating that sort of... ...textured... ...shading effect... ...actually it's a trick... ...yeah... ...what it's doing is... ...it's... ...sampling the plasma... ...at two very very close points... ...and it's seeing... ...it's working out the gradient... ...of the plasma... ...like how fast the plasma map... ...is going up and down... ...and then it's using a... ...very very hacky transformation... ...which approximates... ...light reflection... ...you then add that to the colour... ...and you get something that looks like it's... ...it's being lit... ...yeah... ...but it's a complete hack... ...it's just a little mathematical trick... ...which is producing that effect... ...so yeah... ...so that's an example of using plasma for a height map... ...and then using that height map... ...both to produce the colours... ...of the landscape... ...and also the rendering... ...so the sort of texture on the light... ...you can also use plasma for... ...colours... ...and I think this is a slightly crazy one... ...yeah... ...so if you actually put plasma into your... ...I don't even know how this one works actually... ...it's looping up... ...it's using a plasma... ...to loop through another plasma... ...and you get nice colours out... ...it's sort of like a... ...makes you think of some kind of... ...multicolour fruity ice cream... ...or something like that... ...um... ...yeah, one of my friends made this one... ...so again that's using... ...that's using some noise... ...and sort of distorting the colour through... ...through plasmas... ...and you get some sort of interesting swirly patterns... ...um... ...and... ...this one is of course a very... ...famous...famous one... ...probably all familiar with this... ...that's the good old... ...mandal buset... ...um... ...and you can do that with the... ...you can do that with the Clisk AST... ...yeah, there's actually a... ...very, very primitive... ...but it works... ...factal... ...function... ...yeah, which says... ...um... ...it's got a sort of termination condition... ...so while the length of the vector is... ...less than two... ...it's going to update... ...the position to... ...this is actually sort of a mandible related formula... ...it's something like... ...Z squared... ...Z squared plus C or something like that... ...but it's got a real and imaginary component... ...and then it's taking the result of that... ...those iterations... ...it's counting how many iterations... ...it's... ...it's doing... ...and it's using a V plasma to sort of... ...as a colour... ...so basically a colour map... ...let's try that... ...one sec... ...let me try a... ...it's all C... ...yeah, so that colour... ...the colour I'm using here... ...is the same as the map used for the landscape... ...so you can just... ...lost the image... ...and there's a max iterations... ...so if... ...if you want these things to finish and find out time... ...you need to stop iterating... ...and... ...so... ...it doesn't take forever... ...and then you can say a bailout colour... ...so if you don't actually... ...reach the end... ...what colour do you want the remaining part of the image to be? ...yeah... ...so it's a bit hacky... ...you can't do every single possible factor with that... ...but you can do actually quite a lot of... ...the sort of classic factor based images... ...using that technique... ...and see it's pretty fast... ...so... ...you can do double based maths... ...otherwise it would be a bit slower than that... ...ok... ...any questions about... ...any of that? Yeah, sure... Can you modify the scene? I wish, sorry... When you run the landscape... ...you only get the same result... Ah, yeah... ...ok, very good question... ...um... ...so you want... ...it to be different each time... ...ok... ...so... ...or just different ones... ...or different ones... ...so, well, let's just... ...let's just analyse how it's working... ...yeah... ...so... ...it's using... ...it's using plasma... ...as the... ...for the Z coordinate... ...yeah, so this is this...let Z is this V plus... ...with a plasma... ...we want a different plasma... ...yeah, in order to get a different... ...a different map... ...um... ...now plasma is pseudo-random... ...yeah, it... ...it looks random but it's actually always will... ...if you look at the same part of the plasma... ...it's always going to come up with exactly the same result... ...yeah... ...so in order to get different plasma... ...it's quite simple... ...you just need to look at a different part of the... ...part of the plasma... ...so let's just do... ...try this... ...if I do offset 100 plasma... ...should work... ...that's different, yeah... ...yeah... ...remember that image... ...so yeah, so basically you're sort of just moving around... ...to different parts of the plasma... ...and then you get a different landscape... ...the seed... ...the seed for the plasma... ...is fixed... ...yeah... ...I guess it doesn't have to be... ...but... ...if you want to use a different... ...if you don't like the one you got... ...you just offset it... ...to somewhere far into the distance... ...and then it's completely unrelated to the one you just had... ...so effectively you're using the offset... ...as a seed in order to get different images... ...good question though... ...because that's very important... ...if you artistically don't like... ...what came out of the random number generator... ...you want to run a random number generator... ...you want to run your random number again... ...yeah, so this is... ...a trick for doing that... ...but you're right actually... ...I should probably add a seed function in as well... ...I think... ...the only thing that's slightly challenging about that... ...is there's a bunch of pre-generated... ...tables... ...used to create the noise... ...so you'd probably for each seed... ...you'd probably have to re-initialise the tables... ...and you'd have to... ...fiddle around a bit of that kind of stuff... ...but it's not too hard... ...yeah, certainly be possible. Pan over the landscape... ...like flying over the... ...the island? The answer is yes... ...I was just about to do it... ...but I just thought how long it took to render there... ...it wouldn't look good in real time... ...but yeah, all you'd be doing is you'd take... ...your iteration counter... ...and you'd be offsetting the plasma... ...just like we just did... ...you'd be changing that offset over time... ...and pan over the landscape... ...or you could change the scale as well... ...and zoom in and out... ...so yeah, it's... ...it's quite flexible on that kind of thing. One of the things with this... ...is you do have to know a bit of maths... ...so you have to think of your geometry... ...and offsets and scales... ...and all of this kind of thing. So I guess it's a little bit niche... ...in that respect... ...it will appeal to programmer artists... ...who doesn't have software... ...or at least decent maths experiments... ...would have trouble using this tool. But hey, I did it because I love it... ...rather because I'm expecting it to be adopted... ...by artists worldwide. Do you want to see some more examples? How much time do we have? Up to the next speaker. If there's any more questions quickly... ...or... ...do you have any other topic... ...or any suggestion for a similar library... ...for closure script? I've not seen one. I think this could be... ...ported to closure script. I don't see any... ...fundamental barrier. Yeah, it could be. That would be an interesting project actually. I think you could basically convert most of it to CLJC. There would be... ...complexities around the... ...image handling. You'd probably have to... ...write that separately... ...and there'd be complexities around the wrapper... ...which is like... ...creating the... ...windows and stuff like that. You'd have to do it completely differently with the browser... ...but the core logic and the ASTs and the nodes... ...I think would translate... ...pretty directly. Interesting idea. Anything else? Okay. Interest of time. Thanks very much for listening. I hope you've enjoyed that. Obviously if any more questions... ...or if anyone wants to dive into the technical details... ...of how... ...some of this works, then happy to chat later. Okay. Thank you very much. Cheers.