Jump to content

Recommended Posts

Posted

AABB and these commands are what I had in-mind.

virtual bool IntersectsPoint(const Vec3& p, const float radius=0);//lua
virtual bool IntersectsAABB(const AABB& aabb, const float overlap=0);//lua
virtual int IntersectsPlane(Plane plane);//lua
virtual bool IntersectsLine(const Vec3& p0, const Vec3& p1, const float radius=0.0);//lua
virtual float DistanceToPoint(const Vec3& point, const float radius=0);//lua

 

Cyclone - Ultra Game System - Component PreprocessorTex2TGA - Darkness Awaits Template (Leadwerks)

If you like my work, consider supporting me on Patreon!

Posted

An "AND" operation would be cool to have in the AABB class. I guess this could create a bounding box from the intersecting volume of two AABBs.

Boolean-Ven.jpg

  • Like 1

My job is to make tools you love, with the features you want, and performance you can't live without.

Posted

What I really want is to make a plane on the ground and find all the objects that are intersecting it by the space they're occupying or the "hole" they're making in the plane. Ultimately I'm trying to develop a pixel depth offset effect like Unreal has but all their tutorials are using that goofyass node system. Some of them are doing this weird thing with that force field shader where they're using a depth buffer as a texture like "texture(depthbuffer, fragcoords);" What's the LE equivalent of that? Bounding boxes are probably good for finding the area but seems like a lot to do just to discard that space.

Posted

If this is what you are trying to do, it looks to me like it is a combination of:

  • Apply a color when the Z component of the normal is near zero (edges).
  • Apply a color when underlying depth value is near the current draw Z position. It looks like a screenspace depth effect, which is why the effect is abruptly cut off on the left side of the box in the foreground.

shaderforcefieldsimple.png

My job is to make tools you love, with the features you want, and performance you can't live without.

Posted

Man I'm always in over my head. Sounds like what you're saying is a fresnel and using the DepthToZPosition that is in your water shader with vec3 screencoord?

That's what I think I want. The problem I'm having is with the parallax shader. When I set things on it they look like they're floating above it. The rock highs and lows don't interact with like a box or tree model. So if you recall you can just cut the parallax texcoords and they appear to have a 3d "beyond the geometry" look. So if I can find all the intersections of items set on the parallaxed surface I can then discard those areas to give that impression on everything. UE's Pixel Depth Offset is the closest thing I've seen to accomplish this though I'm not entirely sure this is what they're actually doing. What approach do you recommend for solving that?

Posted

You could manually write the pixel depth. Stalker did this for their shadowmaps. However this means you will lose early Z discard, which will make the shader more expensive.

My job is to make tools you love, with the features you want, and performance you can't live without.

Posted

I think you just o this:
gl_FragCoord.z = z position

You might have to convert to a depth value.

My job is to make tools you love, with the features you want, and performance you can't live without.

Posted

I've been meaning to pull the water shader apart to see how it works. I guess now is as good a time as any. Anything I should take note of specifically to get what I'm looking for like the fog or the amplitude or something?

Posted

I think the shader compares the current depth to the stored one to control the transparency.

  • Like 1

My job is to make tools you love, with the features you want, and performance you can't live without.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...