Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411513 Posts in 69380 Topics- by 58436 Members - Latest Member: GlitchyPSI

May 01, 2024, 12:13:03 AM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsCommunityDevLogsVatnsmyrkr【submarine exploration】
Pages: 1 ... 10 11 [12] 13 14 ... 18
Print
Author Topic: Vatnsmyrkr【submarine exploration】  (Read 42737 times)
oahda
Level 10
*****



View Profile
« Reply #220 on: November 18, 2015, 08:28:25 AM »

You mean a bloom effect (blurring light)?
Nah, I just want to smooth the edges out a bit so that the lights aren't that hard where they get cut off by occlusive geometry.

Occlusion is a repurposed z buffer?
It's just one channel that's 1 if there's something in the scene that's solid to lights so that it cuts off light if it gets in the way, and 0 otherwise. There's a picture in the update before the last one.

By highlight you mean the specular contribution?
Nah, just the pixels that get lit because they're normals are facing the light more or less.
Logged

gimymblert
Level 10
*****


The archivest master, leader of all documents


View Profile
« Reply #221 on: November 18, 2015, 08:58:39 AM »

Is that breakdown is correct?

pass 1 (g buffer rendering)
- render color channel
- render normal channel
- render occlusion channel

pass 2 (light pass )(saved on a new channel? replace normal? how does it fed into pass3?)
- raycast - ideally blurred
- diffuse lighting
- raycast mix with diffuse (not what happen in code i think)

pass 3 ()
- blur light
- water shader mix on top color
- final mix

On the spot:
- it seems that maybe you might need to modify the raycast so that it make less sharp edges, what if for each pixel rejected for raycast: sample their neighbor, neighbor rejected for raycast have a value of zero, those eligible for raycast have values set to the distance from light.

- simpler: blur using the occlusion as a mask to protect lighted objects.

Logged

oahda
Level 10
*****



View Profile
« Reply #222 on: November 18, 2015, 05:29:59 PM »

Not entirely. I'll show you in images. I've put a red dot where the light is positioned.

Pass 1: colour — normals — occlusion



This is what pass 2 lighting would look like without normals:



But it actually looks like this since I do calculate the final light by taking the normals into account:



Pass 3 takes the colour buffer from pass 1 and adds water (calculating it directly in this pass; no water buffer), ambient light (just tinting everything and setting the overall brightness) and finally blends it with the brightness values of the light buffer from pass 2:



Of course, the light looks smooth in these images because it's so big and I only showed you an area where it doesn't stream out of any opening, but look at this for example:



It would be nice to have those rough edges blurred. Thinking about it now, perhaps I can just write the result of the lit normals to one buffer and the result of the light itself to another, because as you can see in this image above the shape of the light kind of disappears when there are normals behind and I don't want that either... It might work. The normals won't be lit at the edges where the blur gets applied, but maybe that doesn't matter.

I'll give it a try..?
Logged

gimymblert
Level 10
*****


The archivest master, leader of all documents


View Profile
« Reply #223 on: November 18, 2015, 06:46:55 PM »

I realized how dumb my own the spot idea was now lol

However it's a bid unfortunate you didn't choose an image with significant occlusion as example (I thought the sub would occlude but don't).

But isn't the blur kernel basically a sample of neighbor average into the current pixel? I mean is there a way to mix that with the raycast formula?
Logged

gimymblert
Level 10
*****


The archivest master, leader of all documents


View Profile
« Reply #224 on: November 18, 2015, 07:01:56 PM »

I googled to see if there was smooth 2D shadow example with code
https://github.com/mattdesl/lwjgl-basics/wiki/2D-Pixel-Perfect-Shadows

they seems to use a different method, don't know if this is useful to you
Logged

oahda
Level 10
*****



View Profile
« Reply #225 on: November 18, 2015, 07:07:01 PM »

I already got it! Hand Thumbs Up Right Thanks anyhow tho! c:

Did it like I said. Might need to fine-tune the blur a bit, but it's working:



And if the light is really bright now I do see the white on the wall as intended:



So now I just separate light without normals and light with normals into one buffer each, so using the images from my last post, I now have two separate buffers like this:



I then apply blur only to the one without the normals and finally I multiply the colour buffer by the sum of these two light buffers. Hooray!

This is also cool since I was planning on having glow maps (as described on this page) as well, and now I can just put those into the same buffer as the light and have the blur applied to them as well.
Logged

gimymblert
Level 10
*****


The archivest master, leader of all documents


View Profile
« Reply #226 on: November 18, 2015, 07:09:50 PM »

Ah cool! Was trying really hard to not had a new buffer lol.

Congratz!
Logged

oahda
Level 10
*****



View Profile
« Reply #227 on: November 18, 2015, 07:22:25 PM »

Oh, right. I said I'd rather not to have a new buffer. Ah, well, it seemed impossible in the end. Tongue

In motion with a super bright light that you can really see the shape of now (the thing on the floor isn't normal mapped):

Logged

gimymblert
Level 10
*****


The archivest master, leader of all documents


View Profile
« Reply #228 on: November 18, 2015, 07:23:51 PM »

Why is the belly lighting up when away and not when facing the light?
Logged

oahda
Level 10
*****



View Profile
« Reply #229 on: November 19, 2015, 03:45:23 AM »

Well, the texture is kind of white on the belly and almost black on the rest of the body, so maybe it's that. Or maybe something's wrong. I'll look into it. Hm.
Logged

chriswearly
Level 3
***


prince slugcat


View Profile
« Reply #230 on: November 19, 2015, 03:51:19 AM »

Well, the texture is kind of white on the belly and almost black on the rest of the body, so maybe it's that. Or maybe something's wrong. I'll look into it. Hm.
It almost looks like reflected light from the walls(?) are lighting the belly. Just stumbled into this devlog so I dunno the details though.
Or you have a forgotten light-source on the lower-right? :/
Logged

oahda
Level 10
*****



View Profile
« Reply #231 on: November 19, 2015, 04:04:23 AM »

Just looking at the GIF for a litle bit now, I think it's the normals rotating in the wrong direction when the sprite is mirrored.
Logged

gimymblert
Level 10
*****


The archivest master, leader of all documents


View Profile
« Reply #232 on: November 19, 2015, 01:55:21 PM »

you should do a visualization shader, I recommend a cut off step shader (basically a too shader) with contrasting color, for example plain green in direction of light and plain red in the opposite direction (maybe blue in between to visualize midrange).

If green is away from the light then it's wrong lol
Logged

oahda
Level 10
*****



View Profile
« Reply #233 on: November 19, 2015, 11:36:02 PM »

Yeah, well, it's not too hard to see if it's wrong just by looking at what parts of the sprites light up. I wonder how I missed it because I saw it clearly as soon as it was pointed out. Tongue I haven't been back at the computer yet, but yeah, I'm quite sure it's the normals rotating in the wrong direction when the sprite is mirrored.
Logged

oahda
Level 10
*****



View Profile
« Reply #234 on: November 20, 2015, 02:34:25 PM »

Fixed it!

Logged

ProgramGamer
Administrator
Level 10
******


aka Mireille


View Profile
« Reply #235 on: November 20, 2015, 02:45:33 PM »

Why is the "helmet" part of the submarine pink now? Wasn't it green before?
Logged

oahda
Level 10
*****



View Profile
« Reply #236 on: November 20, 2015, 03:02:03 PM »

It was always sort of purple. We're trying out new colours based on real sea creatures now tho but we never got that far with it so there's lots of work left to be done (as you can see, almost every part is still just grey which it isn't going to be).
Logged

Schoq
Level 10
*****


♡∞


View Profile WWW
« Reply #237 on: November 21, 2015, 06:01:51 AM »

Hey this is really cool looking
Logged

♡ ♥ make games, not money ♥ ♡
Cakeprediction
Level 1
*


I'm not too sure what to put here


View Profile WWW
« Reply #238 on: November 21, 2015, 07:50:48 AM »

wow, that new lighting is so pretty  Who, Me?
I really, really want to play this :D
Logged

Huge Swords and Tentacles Devlog
"If you were to write a story with me in the lead role, it would certainly be... a tragedy"
"You have to tell your hands to freaking do the stuff until your hands know it by their tiny hand hearts"
Zorg
Level 9
****



View Profile
« Reply #239 on: November 21, 2015, 08:52:49 AM »

I guess this game would still look very pretty in black and white (or an additional gradient map with blueish colors, or multiple gradient maps depending on the current diving depth).  Hand Thumbs Up Left Smiley
Logged
Pages: 1 ... 10 11 [12] 13 14 ... 18
Print
Jump to:  

Theme orange-lt created by panic