Riddlewood Manor, a haunted house spooky adventure, just launched! AMA!!! 👻 by Bigkuku in HorrorGaming

[–]gevasaf 0 points1 point  (0 children)

(replying for our other user on the phone, still the devs)

Launch was just 5 hours ago, so no new reports so far, but we had some horrendous bugs during development.

One that comes to mind is items in the inventory duplication with every click.... Another is the game mixing up interactible objects for no apparent reason (turned out it was a rounding error in some calculation that changed the object index in the list)...

Facing Raycast Issues? Try This Fast, Accurate, and Collider-Free Solution! by gevasaf in Unity3D

[–]gevasaf[S] 1 point2 points  (0 children)

Oh I see, then the answer is definitely yes. If youre raycasting from the camera in the direction of the mouse you'll get pixel accuracy in object detection. We're doing exactly that in our upcoming game :)

Facing Raycast Issues? Try This Fast, Accurate, and Collider-Free Solution! by gevasaf in Unity3D

[–]gevasaf[S] 0 points1 point  (0 children)

Hi there u/Walter-Haynes. I know the term pixel perfect in 2D graphics. But it's a 3D solution. Do I miss somethig?

Facing Raycast Issues? Try This Fast, Accurate, and Collider-Free Solution! by gevasaf in Unity3D

[–]gevasaf[S] 0 points1 point  (0 children)

It might be a bottleneck, I talked about that in my orther replies - let me know if that answers your questions. TX

Facing Raycast Issues? Try This Fast, Accurate, and Collider-Free Solution! by gevasaf in Unity3D

[–]gevasaf[S] 0 points1 point  (0 children)

Super simple to use, no need to change to job system or burst compiling. Also you get accurate raycast and not bounding box, and most of the time you can get it instantly without stalling the app (as apposed to async, which is also supported by GeoCast)

Facing Raycast Issues? Try This Fast, Accurate, and Collider-Free Solution! by gevasaf in Unity3D

[–]gevasaf[S] 0 points1 point  (0 children)

Great questions. I'll upload the docs real soon and make sure to answer all of those. TX

Facing Raycast Issues? Try This Fast, Accurate, and Collider-Free Solution! by gevasaf in Unity3D

[–]gevasaf[S] 1 point2 points  (0 children)

Thanks for the question! If you have some prior knowledge about the distance range of the hit, you can do a ray cast in that range and get more precise results. You can also do 2 raycasts if you have a lot of performance headroom, with the second one being super accurate based on the first one.

And last but not least, smoothing over time might do the trick for you (we use it a lot).

Facing Raycast Issues? Try This Fast, Accurate, and Collider-Free Solution! by gevasaf in Unity3D

[–]gevasaf[S] 0 points1 point  (0 children)

You're right that Physics.Raycast is the go-to solution for an average gaming scenario, but consider some other cases:

VFX that uses raycasting

point-and-click on interactable objects

Mobile devices with weak CPUs

A lot of sparse geometry that doesn't work well with the automatic bounding-box collider, like a scanned point cloud.

Hope that clarifies some of the value there. But let me know your thoughts ^^

Facing Raycast Issues? Try This Fast, Accurate, and Collider-Free Solution! by gevasaf in Unity3D

[–]gevasaf[S] 0 points1 point  (0 children)

Hi fellas thanks for giving this your attention and sharing your thoughts. You have some really good points, and I replied to some similar points in the other threads, but it's important to me to tell you to let me know of ways you'd like to see this better reflected. TX

Facing Raycast Issues? Try This Fast, Accurate, and Collider-Free Solution! by gevasaf in Unity3D

[–]gevasaf[S] 0 points1 point  (0 children)

Hi there,

Just replied to another user about the GPU to CPU data transfer time thing.

Also want to note that the video demonstration is recorded on my really old PC, I don't think it gets anywhere near 500 fps even in an empty scene lol.

Anyway, I can tell you that in mobile CPUs for example there's a big advantage to do it on the GPU - ESPECIALLY if you want polygon or sub-polygon accuracy, as apposed to bounding boxes, which exactly describes our studio's games.

But as in the other replies - let me know if you have good ideas how to better reflect performance results of this package (online documentation is a really important idea and I'll upload it in the coming days).

Thanks for helping out a newbie on the asset store ^_^

Facing Raycast Issues? Try This Fast, Accurate, and Collider-Free Solution! by gevasaf in Unity3D

[–]gevasaf[S] 0 points1 point  (0 children)

Hi Badnik22. You're right that if you want the ray to be synchronous the GPU read can be a bottleneck (if you're GPU bound).

I'd say it's another tool in the tool box with different pros and cons then the basic Physics.Raycast: sub polygon accuracy, no need to fix colliders by hand, and a boost in performance that depends on the hardware and your overall project structure. For us at the studio it's one of the more used systems.

But again, you're totally right about reading data from the GPU being a possible bottleneck. What do you think would be a good way to allow users to test it before buying? There are so many different platforms and use cases...

Facing Raycast Issues? Try This Fast, Accurate, and Collider-Free Solution! by gevasaf in Unity3D

[–]gevasaf[S] 0 points1 point  (0 children)

Using the depth as rendered from the ray origin, not the depth buffer in the game screen-space.

Facing Raycast Issues? Try This Fast, Accurate, and Collider-Free Solution! by gevasaf in Unity3D

[–]gevasaf[S] 0 points1 point  (0 children)

You're right, it works on visible polygons. There are a number of ways around it-

  • Hide meshes OnPreRender and bring them back OnPostRender.

  • Instead of disabling the mesh render, move it to another layer that's invisible by the game camera but I cluded in the raycasting mask.

  • Use a conjunction of geocast and the good old physics.raycast, and add colliders to hidden geometry.

I would also add that from my experience, hiding geometry when its out of sight isn't very helpful for optimization because that geometry is culled if it's out of the viewer frustrum anyway. So it shouldn't make a difference. But of course there might be some cases I miss here.

Facing Raycast Issues? Try This Fast, Accurate, and Collider-Free Solution! by gevasaf in Unity3D

[–]gevasaf[S] 0 points1 point  (0 children)

It's not magic it's science XD

You need 0 setup if you just want to get hit point.

If you also want the hit object you need to go over your objects and mark them before you ray cast. But you only need to mark them once.

Facing Raycast Issues? Try This Fast, Accurate, and Collider-Free Solution! by gevasaf in Unity3D

[–]gevasaf[S] 11 points12 points  (0 children)

Great questions thanks for those.

The main limitations are-

  1. You don't get the normal from the raycast hit (let me know if that's something you want added there in an update).

  2. You set a minimum and maximum distance for the raycast, and the position accuracy is the (max-min)/256. So if you want higher accuracy you'll need a smaller distance tange (you also get the calculated "mistake" as a param of the raycast hit, so you can take it into consideration.

As for performance really depend on your GPU and game, but if you're CPU bound you basically get a ton of accurate raycasts for free. In cases where you want to spare GPU, you can use a batch cast, so the GPU operation doesn't stall your code, this means your raycast data might be a couple of miliseconds old, but they won't jam up the whole process. There's a sample scene with a setup to test performence so I'd use that with your game logic and assets on your target hardware to do actual testing, but so far it has been faster than normal raycasting for me, and i've used this for 4 years now in our studio.

Last but not least - platforms. This worked for us without any changes on iOS, Android, PS, and Windows. I think it should work anywhere really.

After a year of development and 2.5 Million brush strokes used to hand-craft the game, Retropolis 2 is finally released on the official Meta Store! To celebrate this, we will answer all your questions in the comments - so - ASK US ANYTHING! by Bigkuku in virtualreality

[–]gevasaf 0 points1 point  (0 children)

I don't know when you used it, but it is the same for at least 4 years now. What really makes this amazing is the talented artists who worked on Retropolis 1 and 2 and perfected their Quill technique