Share a Shader!
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- slime
- Solid Snayke
- Posts: 3161
- Joined: Mon Aug 23, 2010 6:45 am
- Location: Nova Scotia, Canada
- Contact:
Re: Share a Shader!
Out of curiosity, which card do you have? (if it's an intel one, be as specific as possible :p).
- Jasoco
- Inner party member
- Posts: 3726
- Joined: Mon Jun 22, 2009 9:35 am
- Location: Pennsylvania, USA
- Contact:
Re: Share a Shader!
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
Also works on my Mac mini's NVIDIA GeForce 320M.
/Explanabrag
Re: Share a Shader!
You are right.slime wrote:if it's an intel one
Guess I need to try another PC instead.
- Jasoco
- Inner party member
- Posts: 3726
- Joined: Mon Jun 22, 2009 9:35 am
- Location: Pennsylvania, USA
- Contact:
Re: Share a Shader!
So what's your card?utunnels wrote:You are right.slime wrote:if it's an intel one
Guess I need to try another PC instead.
Re: Share a Shader!
Intel (R) G33/G31 Express Chipset Family
- slime
- Solid Snayke
- Posts: 3161
- Joined: Mon Aug 23, 2010 6:45 am
- Location: Nova Scotia, Canada
- Contact:
Re: Share a Shader!
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!
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.SiENcE wrote:3D projection
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);
- Attachments
-
- raycast.love
- (69.75 KiB) Downloaded 632 times
Re: Share a Shader!
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.
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!
I've updated all my examples to the latest 0.8 build, hopefully they will be useful to someone.
Re: Share a Shader!
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
click to spawn a shockwave
- Attachments
-
- shockwave.love
- (156.32 KiB) Downloaded 858 times
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 8 guests