Page 6 of 33

Re: Share a Shader!

Posted: Wed Feb 08, 2012 4:58 am
by slime
Out of curiosity, which card do you have? (if it's an intel one, be as specific as possible :p).

Re: Share a Shader!

Posted: Wed Feb 08, 2012 5:28 am
by Jasoco
Well, I know the Intel 3000 HD in my MacBook Air supports shaders as well as a surprisingly huge amount of canvases up to 4096x4096 pixels. In laymans terms, it supports a boatload more than I'll ever need to use.

Also works on my Mac mini's NVIDIA GeForce 320M.

/Explanabrag

Re: Share a Shader!

Posted: Wed Feb 08, 2012 5:31 am
by utunnels
slime wrote:if it's an intel one
You are right.

Guess I need to try another PC instead.

Re: Share a Shader!

Posted: Wed Feb 08, 2012 5:54 am
by Jasoco
utunnels wrote:
slime wrote:if it's an intel one
You are right.

Guess I need to try another PC instead.
So what's your card?

Re: Share a Shader!

Posted: Wed Feb 08, 2012 6:07 am
by utunnels
Intel (R) G33/G31 Express Chipset Family

Re: Share a Shader!

Posted: Wed Feb 08, 2012 6:41 am
by slime
Ah, yeah. That's the Intel GMA 3100 I think. The GMA 900, 950, 3000 (not to be confused with the Intel HD 3000), 3100 (not to be confused with the Intel GMA X3100), and 3150 don't support programmable OpenGL shaders. :/

Re: Share a Shader!

Posted: Wed Feb 08, 2012 11:36 am
by vrld
SiENcE wrote:3D projection
For that you'd have to write your own 3D transformation code inside the pixel effect. While this is possible, you probably shouldn't do it. LOVE is a 2D engine after all. But if you insist, it's probably the easiest to use some kind of raycasting algorithm. Depending on where the ray hits a textures the surface, you can calculate the texture coordinates, which you can then use with the Texel(tex, coords) function.
I'll try to write a simple example when I'm home.

Edit:
Here it is. It is a simple raycaster implementation showing two spheres with faked ambient occlusion. Texture coordinates are computed using the surface normals of the spheres. I tried to optimize it somewhat for speed, but even now it is not very fast, so you probably not do this in an actual game. The relevant code bit is this:

Code: Select all

// use normal for texture coordinates
tc = n.xy * .5 + vec2(.5);
return Texel(texture, tc) * vec4(ao,ao,ao, 1.0);
Play with different ways to calculate the texture coordinates (e.g. tc = n.zy * .5 + vec2(.5)) to see how this works.

Re: Share a Shader!

Posted: Wed Feb 08, 2012 5:15 pm
by SiENcE
Thats nice vrld. Thanks for this shader!

I know that Love2D is a 2D engine, but sometimes it's usefull to have 3d projections instead of precalc different textures.

Thx.

Re: Share a Shader!

Posted: Fri Apr 06, 2012 12:39 am
by kraftman
I've updated all my examples to the latest 0.8 build, hopefully they will be useful to someone.

Re: Share a Shader!

Posted: Thu Apr 12, 2012 5:12 am
by titangate
Here's a shockwave shader i ported from some random website. Purely experimental, and please forgive me for losing track the source :(

click to spawn a shockwave