How to Line Trace in all directions?

sure yeah that works, But I dont mean a sphere object/mesh, I mean just render a small spherical area around the impact point on the screen and nothing else. So if theres no impact point, it just black, or else its like a small 10-20 diameter spherical rendered area per impact point

Ah, you’re talking about the post processing again now.

Lemme think…

basically kind of like blanket the whole world map in black until it gets hit by a trace, then render a small area around that hit and nothing else. So almost like everything is hidden until discovered by the trace

It’s basically that vid I linked to above. Except he has one sphere above the player, and you want hundreds of little spheres.

the video about the cut through objects mask? I didnt watch it yet, but I guess yeah kind of, but hes using it completely differently it seems, idk

But see hes using it to remove an area, we would first need to have the whole world be black and then remove that with the sphere

The only chance you have of ever getting anywhere near this is by having a material parameter collection. Say you have 100 locations in the collection. The PP material can check if each point in space is near one of the spheres. If it is, it renders it, otherwise don’t.

The problem with that is ( apart from it being a nightmare ), is that the air between the camera and the player ( first or third person ) would be black, and you wouldn’t see anything.

Isn’t what you want here, just a very dense fog?

I can imagine it working in first person somehow, because they can ‘see down the cones’.

But in 3rd, nah, you could do it, but I think this a ‘whole game’ concept. You need to have two copies of the level. One is empty, one has the stuff in it. If the player can see something, just render that part of that mesh, otherwise render the empty level to the camera.

Do you see what I mean?

EDIT: Still thinking…

ofcourse there has to be a small sphere of vision around the player at all times, and ofcourse the air between the camera and player has to be visible/rendered normal, and the air the between the trace start and impact point/sphere-reveal-area also has to be visible

EDIT: This is getting ridiculous lol

What you want to do is not easy. And ( if you’ll pardon me ), you haven’t thought it through.

You want to render the air between the camera and the player, but what’s in it?

I think we got a misunderstanding about the air between the camera and player character, I know the 3D effect that I want from the tutorial but in this new approach right now yeah I’m kind of trying to tackle the problem from different angles and see what shakes out

I might have something, gimme a bit longer…

Very crap and early days

crap

Slightly less crap

lesscrap

Oh thats interesting but the area in front of the player should not be black, because the character can see very far, it should only be black behind obstructed view such as around a corner or on a higher ledge

For example this is what this angle should kind of look like

The blue area will be culled/transparented away, while only the small area in the be visible according to the characters sight line, and same with the area on the right

EDIT: ofcourse when you turn the camera to the right, the blue area will become solid and the wall on the left next to the player with the ladder will become culled, but the black parts will still remain until you move ofcourse

I think this is perfectly possible, and it’s a post process.

You’ll find tuuts for cutting away parts of meshes, ones for a sphere around the player ( I just did that ), and it’s not much of a leap to make one that blackens based on height.

You’ll need to combine them.

I’m just gonna try the height thing now, and then give up :smiley:

Yeah you may have something there, thanks I appreciate it.
Yeah the area on the right side with the top of the ladder showing because of how close the player is to wall, is the tricky one. see if the character closer to the ladder next to it then the view to the ladder above get blackened. Also the top and below the stairs is another tricky one.

EDIT: also the blue wall culling needs to depend on the angle of view, so that it works properly for the rest

So now I’m fading outside the sphere and height.

evenlesscrap

I can see @pezzott1 typing, I’m sure there’ll be some good points…

1 Like

One quick idea: would it be possible to divide the screen into a grid inside the material, then trace from the camera to world then to player, if trace cant hit player then that cell alpha = 1, else = 0?

Thing is this fog effect has been done in very old games and I doubt it was this expensive. With this approach you couldnt be able to show areas where en enemy above fires, for example.

Now we’ve switched to the PP approach, it’s not expensive at all :slight_smile:

1 Like