Search found 5 matches
- Mon Dec 29, 2014 8:57 am
- Forum: Support and Development
- Topic: Passing a table to a shader
- Replies: 9
- Views: 13844
Re: Passing a table to a shader
Hi again! As I said in my previous reply, I tried to remove the "extern", and use instead a const array (so no need to use any parameter slot at all). Well, I was very surprised to notice a dramatic loss of framerate. The result was about 2 FPS; Adding a "const" seems to boost it...
- Sat Dec 27, 2014 12:41 pm
- Forum: Support and Development
- Topic: Passing a table to a shader
- Replies: 9
- Views: 13844
Re: Passing a table to a shader
Well, I managed to make it work :) I am not sure why you feel using a texture is overkill. When you pass a texture you a) Give the shader something it's made to work with and work with fast b) Only use up one shader parameter slot As I said, this is a totally new world for me; "texture" so...
- Wed Dec 03, 2014 2:27 pm
- Forum: Support and Development
- Topic: Passing a table to a shader
- Replies: 9
- Views: 13844
Re: Passing a table to a shader
I think that in this case you don't need to send anything... (I assume that 600 is screen height) myShader = love.graphics.newShader[[ vec4 effect( vec4 color, Image texture, vec2 texture_coords, vec2 screen_coords ){ //note that GLSL counts y coordinates from the bottom of the screen so you may wa...
- Wed Dec 03, 2014 2:20 pm
- Forum: Support and Development
- Topic: Passing a table to a shader
- Replies: 9
- Views: 13844
Re: Passing a table to a shader
If you're passing 600 values to the shader you're probably doing something wrong already, but nevertheless this could work: myShader:send("field",unpack(field)); Thanks S0lll0s! The idea is to pass the 600 values only once. I'm new to shaders, but I've seen peoples passing whole texture i...
- Wed Nov 26, 2014 2:05 pm
- Forum: Support and Development
- Topic: Passing a table to a shader
- Replies: 9
- Views: 13844
Passing a table to a shader
Hi, First of all, I'm new to Löve, to lua and to glsl shaders, so I apologize in advance if I ask something stupid :). I'm trying to achieve a simple starfield effect, and I think it should be interesting to use pixel shaders for this. I made some tests and I'm getting there, however I do have an is...