Search found 106 matches

by Whatthefuck
Tue Jun 24, 2014 7:04 am
Forum: Support and Development
Topic: Using shaders to compute lighting?
Replies: 13
Views: 7329

Re: Using shaders to compute lighting?

Probably way off base but is this anywhere close to what you want? No, what I want to do is compute static world lighting, but since it isn't exactly possible because I'd have to send a table containing 256 indexes, I'll just stick to what I have coded so far. :) The shader you showed could be usef...
by Whatthefuck
Mon Jun 23, 2014 3:51 pm
Forum: Support and Development
Topic: Using shaders to compute lighting?
Replies: 13
Views: 7329

Re: Using shaders to compute lighting?

Ranguna259 wrote:I dont' think that GLSL accepts tables that have more than 4 indexes (vec4)
I see, thank you.
Well, regardless, the lighting compute is fast as it is, so this shouldn't be a problem anyway.

Thanks for the answers, everyone.
by Whatthefuck
Mon Jun 23, 2014 11:10 am
Forum: Support and Development
Topic: Using shaders to compute lighting?
Replies: 13
Views: 7329

Re: Using shaders to compute lighting?

There are no "blocks" in shaders, when you program in GLSL you are essentially calculating every pixel on the screen, check Zilarrezko post to get started, shaders is no easy thing so be prepared :P I know, however it's possible to send tables to the GPU and do the same calculations there...
by Whatthefuck
Sun Jun 22, 2014 11:05 am
Forum: Support and Development
Topic: Using shaders to compute lighting?
Replies: 13
Views: 7329

Re: Using shaders to compute lighting?

...it shouldn't be hard to produce the effect you want in GLSL . Sorry I forgot about those two words, more words: you can, use [wiki]Shader[/wiki]s. That's all I needed to know. Code-wise, would it be pretty much the same way I do it on the CPU right now, which is check for 9 nearby blocks and the...
by Whatthefuck
Sat Jun 21, 2014 9:50 pm
Forum: Support and Development
Topic: Using shaders to compute lighting?
Replies: 13
Views: 7329

Re: Using shaders to compute lighting?

Check out this light and shadow lib if you don't feel like reinventing the wheel :P EDIT : But I don't think that this lib works like the light effect shown in the picture you posted, I recomend looking into the links that zilarrezko posted, it shouldn't be hard to produce the effect you want. Did ...
by Whatthefuck
Sat Jun 21, 2014 3:50 pm
Forum: Support and Development
Topic: Using shaders to compute lighting?
Replies: 13
Views: 7329

Using shaders to compute lighting?

Hey everyone. I'm working on a game and I had a question about lighting - is it possible to compute it on the GPU using shaders? Right now the way it works is it builds a sprite batch and performs a draw call. It works great and is very fast (mainly because I'm obsessed with optimization and always ...