Love2D | Shader Tutorial 2 | Simple lighting

  Рет қаралды 13,660

SkyVaultGames

SkyVaultGames

Күн бұрын

Пікірлер: 39
@eliaswenner7847
@eliaswenner7847 6 жыл бұрын
Waiting for tutorial 3 ...
@eboatwright_
@eboatwright_ 3 жыл бұрын
still waiting...
@the_joshi26
@the_joshi26 5 ай бұрын
Still waiting
@eliaswenner7847
@eliaswenner7847 5 ай бұрын
I know the day will come ... I just feel it ...
@theix9393
@theix9393 5 ай бұрын
Still waiting too, since i saw it in 2022 😂
@DolioFoilio
@DolioFoilio Ай бұрын
Waiting .... :(
@calvinj7492
@calvinj7492 4 жыл бұрын
at 16:57 instead of multiplying bby light.power, I found that: float distance = length(norm_pos - norm_screen) * screen.x / light.power; made the power value the pixel radius of the light. Multiplying just by power would mean a value of 1 lights up the whole screen.
@stanosipenko7305
@stanosipenko7305 3 жыл бұрын
For anyone wondering why there's max_num_lights and num_lights, the array size of lights has to be defined in advance, i.e. cannot change over time, so we pick an upper value (max_num_lights). The reason we also have num_lights is that we don't want to cycle through all of the array, if not all of the array is being used (e.g. we have 12 lights out of a maximum 16), because trying to get a light (lights[i]) that doesn't exist could either A. cause an error, or B. be slow.
@eduardomezencio4057
@eduardomezencio4057 6 жыл бұрын
Great! But at the end, I would say the reason why the red light looks darker is that the underlying image is mostly green, having very little of the red component. In a mostly red image, the green light would look darker.
@Xenthera
@Xenthera 5 жыл бұрын
Hey this is really helpful, can you do the third tutorial?
@lonochka9634
@lonochka9634 Жыл бұрын
Up!
@flamendless
@flamendless 6 жыл бұрын
You could do this to automatically send stuffs to the shader! local n = 0 function addLight(t) --t = { --position = {x,y}, --diffuse = {1,1,1}, --power = 128, --} n = n + 1 for key, value in pairs(t) do shader:send(("lights[%i].%s"):format(n, key), value) end end
@SkyVaultGames
@SkyVaultGames 6 жыл бұрын
I really like that solution, ill be doing something very similar in the next episode, thanks!
@thomaszito3019
@thomaszito3019 6 жыл бұрын
when i copied this there was an invisible character that broke the code. you're also sending a shader into lights[1] before lights[0]. Some changes to your function, and in love.draw, and the shader. In the glsl use vec2 screen = vec2(love_ScreenSize), so you don't need to send tthat in draw anymore // glsl change vec2 screen = vec2(love_ScreenSize); n = 0 function addLight(t) local shader = t.shader t.shader=nil for key, value in pairs(t) do shader:send(("lights[%i].%s"):format(n, key), value) end n = n + 1 end
@dill__pickles
@dill__pickles 6 жыл бұрын
Was really looking forward to this! Thanks!
@dontrobthemachina3774
@dontrobthemachina3774 5 жыл бұрын
Love the video, really looking forward to part 3!
@ccgb92
@ccgb92 5 жыл бұрын
i'm learning love2d (from godot), your tutorials are awesome man! appreciate it so much
@shekhawat5917
@shekhawat5917 6 жыл бұрын
Part 3 ???
@flamendless
@flamendless 4 жыл бұрын
This would be cooler if it's possible to use different shapes like cone from texture instead of just circular one
@thomaszito3019
@thomaszito3019 6 жыл бұрын
Neat. Part 3?
@speakki
@speakki 5 жыл бұрын
I could be mistaken, but I believe the power here works in inverse? The power you add, the darker it gets in the scene. I'm not sure how to fix it.
@leeroynewman
@leeroynewman 6 жыл бұрын
Pretty good video, thanks for making it.
@DjSapsan
@DjSapsan 5 жыл бұрын
What ELO in AoE do you have?
@yimoawanardo
@yimoawanardo 6 жыл бұрын
Nice KDE desktop icon there ^^
@johnpayne791
@johnpayne791 6 жыл бұрын
Thank you for the tutorial, it helps a lot. Also what operating system are you using, it looks amazing.
@SkyVaultGames
@SkyVaultGames 6 жыл бұрын
John Payne glad it helped! Im on manjaro Linux using kde plasma :)
@eliaswenner7847
@eliaswenner7847 6 жыл бұрын
Linuxpower !!!
@d33talion
@d33talion 6 жыл бұрын
Thanks! Very helpful video
@flamendless
@flamendless 6 жыл бұрын
Just send the love screen size at load, because it doesnt change it value
@SkyVaultGames
@SkyVaultGames 6 жыл бұрын
brbl thats a good idea! If you do that you also want to send it each time the screen size changes.
@miguelcarmona5273
@miguelcarmona5273 6 жыл бұрын
Great video!
@SkyVaultGames
@SkyVaultGames 6 жыл бұрын
Thank you!
@_modiX
@_modiX 6 жыл бұрын
I'm waiting for a good vertex shader tutorial
@АлексейЮрченко-т5л
@АлексейЮрченко-т5л 6 жыл бұрын
Thanks!
@jeremyskeleton6749
@jeremyskeleton6749 6 жыл бұрын
thanks !
Love2D | Shader Tutorial 1 | Introduction
13:42
SkyVaultGames
Рет қаралды 23 М.
Making a Game in Lua with No Experience
5:52
Goodgis
Рет қаралды 380 М.
Мен атып көрмегенмін ! | Qalam | 5 серия
25:41
Что-что Мурсдей говорит? 💭 #симбочка #симба #мурсдей
00:19
We Attempted The Impossible 😱
00:54
Topper Guild
Рет қаралды 56 МЛН
An introduction to Shader Art Coding
22:40
kishimisu
Рет қаралды 1 МЛН
The game of the year was written in Lua
5:32
Tom Delalande
Рет қаралды 290 М.
Introduction to shaders: Learn the basics!
34:50
Barney Codes
Рет қаралды 383 М.
Intro to Physics in Love2D
13:23
Gabe Stein
Рет қаралды 2,5 М.
Love2D Tiled Tutorial | Episode 1
16:20
SkyVaultGames
Рет қаралды 26 М.
Giving Personality to Procedural Animations using Math
15:30
t3ssel8r
Рет қаралды 2,7 МЛН
The most complex city-building simulator
17:23
StopGame
Рет қаралды 438 М.
2024's Biggest Indie Hit Was Made With... Love!   LÖVE 2D that is.
9:50
Мен атып көрмегенмін ! | Qalam | 5 серия
25:41