3D island in Love2d: fog thoughts?

General discussion about LÖVE, Lua, game development, puns, and unicorns.
User avatar
Madrayken
Party member
Posts: 126
Joined: Sun May 04, 2014 4:21 pm
Location: Oakland CA
Contact:

3D island in Love2d: fog thoughts?

Post by Madrayken »

Hi folks,

I'm planning on making my next game in a weird 3D view using large numbers of billboards. Imagine the rotating island in Yoshi's island and you're close - just 100% side-on. I've got plenty of experience and I think I can bend Love2d to my will.

The only thing I'm not sure about is how best to implement the depth-fog in the shader.

The shader will look at how far the object is from the camera and blend to a standard gradient I'll be using for the sky.

Fog changes with distance from the camera. This 'z' component will be my own creation (i.e. not something the shader knows about), and something I'll have to pass in to the shader somehow. However, I don't ideally want to have to pass in a different Z with every object as that might well create a rather horrific performance hit. Does anyone have any suggestions on how I can feed a shader this information in a slightly friendlier way?

Shaders aren't my strong suit. Spellrazor is an exception - everything I did there was kind of easy.

Edit: Never mind. I've added a love file here: http://www.mediafire.com/download/91rr5 ... sland.love
I'm an idiot. If I'm using buckets to sort, as I do here, I can use the drawing of those bucket-levels as opportunities to change colour, which is already sent to the shader and can be interpreted however I want. It's not super-fast, but it might do.
Discord: https://discord.gg/tYfHgXc
Bandcamp: https://madrayken.bandcamp.com/
Twitter: @Fluttermind
User avatar
Nixola
Inner party member
Posts: 1949
Joined: Tue Dec 06, 2011 7:11 pm
Location: Italy

Re: 3D island in Love2d: fog thoughts?

Post by Nixola »

I think you can use LÖVE3D for that
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
User avatar
Madrayken
Party member
Posts: 126
Joined: Sun May 04, 2014 4:21 pm
Location: Oakland CA
Contact:

Re: 3D island in Love2d: fog thoughts?

Post by Madrayken »

Trying to stick to fake 3d for weird reasons... :-)

https://twitter.com/Fluttermind/status/ ... 72/photo/1
Discord: https://discord.gg/tYfHgXc
Bandcamp: https://madrayken.bandcamp.com/
Twitter: @Fluttermind
User avatar
undef
Party member
Posts: 438
Joined: Mon Jun 10, 2013 3:09 pm
Location: Berlin
Contact:

Re: 3D island in Love2d: fog thoughts?

Post by undef »

Oh dear, this just freezes and looks like this:
screenshot.jpg
screenshot.jpg (28.25 KiB) Viewed 3030 times
I'm on a laptop with an intel i5, so I guess you'd want to optimize...
twitter | steam | indieDB

Check out quadrant on Steam!
User avatar
TheOdyssey
Citizen
Posts: 52
Joined: Mon Jul 13, 2015 4:29 pm
Location: Turn Around...

Re: 3D island in Love2d: fog thoughts?

Post by TheOdyssey »

undef wrote:Oh dear, this just freezes and looks like this:


I'm on a laptop with an intel i5, so I guess you'd want to optimize...
It looks like it's frozen but have you tried the arrow keys?
User avatar
undef
Party member
Posts: 438
Joined: Mon Jun 10, 2013 3:09 pm
Location: Berlin
Contact:

Re: 3D island in Love2d: fog thoughts?

Post by undef »

Oh snap, you're right.
It moves and it moves smoothly, my bad.
I guess my hardware/driver doesn't support the shader you use. What a pity.
twitter | steam | indieDB

Check out quadrant on Steam!
User avatar
CrackedP0t
Citizen
Posts: 69
Joined: Wed May 07, 2014 4:01 am
Contact:

Re: 3D island in Love2d: fog thoughts?

Post by CrackedP0t »

It looks lovely, but I could only run it with my discrete graphics card, so you might want to dumb it down for less advanced ones.
/人 ◕‿‿◕ 人\
Here, have an umlaut. Ö
User avatar
Madrayken
Party member
Posts: 126
Joined: Sun May 04, 2014 4:21 pm
Location: Oakland CA
Contact:

Re: 3D island in Love2d: fog thoughts?

Post by Madrayken »

Hmm. I use lots of weird shaders in my work. Is that frequently an issue with users here?
Discord: https://discord.gg/tYfHgXc
Bandcamp: https://madrayken.bandcamp.com/
Twitter: @Fluttermind
User avatar
undef
Party member
Posts: 438
Joined: Mon Jun 10, 2013 3:09 pm
Location: Berlin
Contact:

Re: 3D island in Love2d: fog thoughts?

Post by undef »

Just tried it on my Windows gaming rig, still doesn't work. Very strange.
twitter | steam | indieDB

Check out quadrant on Steam!
User avatar
Nixola
Inner party member
Posts: 1949
Joined: Tue Dec 06, 2011 7:11 pm
Location: Italy

Re: 3D island in Love2d: fog thoughts?

Post by Nixola »

Um... The build I downloaded has no shaders at all, is that intended?
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 4 guests