#Rendering a 3D model inside another 3D model

1 messages · Page 1 of 1 (latest)

latent pawn
#

I have two 3D models, a spaceship and a cockpit.

I want it so that in-game when I move the cockpit model inside the spaceship model the cockpit model is still visible.

Such as a part of the spaceship becoming transparent, so you can see the cockpit model inside it.

#

I'm trying to use a custom shader graph to do this, but I'm not really sure how to do it.

#

Rendering a 3D model inside another 3D model

cosmic zinc
latent pawn
#

I don't think this is what I'm looking for.

For example, I have a spaceship, and a cone with the center indented inwards. When I move the cone over the spaceship, I want the cone to show the indent in the spaceship. Like the spaceship has a cone-shapes hole missing.

cosmic zinc
latent pawn
#

I believe so.

I'm looking to do two things right now:

  1. I want to start with a spaceship, and then add parts, like weapons, that only show the external bits.
  2. I want to start with a spaceship, and then add in damage, like a indent from a weapon hit.
cosmic zinc
latent pawn
#

The first post about the cockpit was my attempt at giving an example, but it may have been incorrect.

The idea with the cockpit for example was to have the spaceship semi-transparent, and then I could place things like a cockpit inside the spaceship. I just wanted the player to be able to build/add the various parts of the spaceship themselves.

cosmic zinc
latent pawn
#

I believe that when overlaying the indented cone, that it should cut out that portion from the spaceship, so you can see inside the spaceship a bit.

cosmic zinc
latent pawn
#

If I were to add on external weapons and such, that is fine, no cutout is really needed.

If I want to have/show damage to a spaceship, such as weapon hits, then I need the cutouts.

cosmic zinc
# latent pawn If I were to add on external weapons and such, that is fine, no cutout is really...

Yeah, that's what I thought. So regarding the indents, there are really couple ways to go about it. If you really really need the spaceship to be actually destructible as in being able to carve actual holes to the mesh, you might have a long road ahead of you, especially if you wanna do that by manipulating the underlying 3D mesh. Perhaps easier approach would be to use some 3D graphics tricks to make intersections between the two meshes but that too can quickly get complicated and have many edge cases that need to be addressed.

The way bullet holes/impacts are often implemented is via decals. They are like stickers which you can wrap onto any mesh surface. Adding them doesn't actually modify the mesh below them so they are relatively cheap and easy to use (just spawn them at the impact point). If you find good decal textures with normal maps, they can look quite 3 dimensional as if there was actually a whole in there.

#

I'm not sure how advanced the default decal shader is for URP or HDRP, but decals can also definitely use some "parallax occlusion mapping" type effects to add to the 3d look. Nowadays you can use custom shaders for decals too so everything is possible

latent pawn
#

I was looking into using custom shader decals before, but I didn't believe that they would do the job. Such as, some internal part of the spaceship getting damaged, and having to show a hole going into the spaceship to this internal part.

cosmic zinc
latent pawn
#

Both.

#

For now, just the bullet impact tunnel going through the ship all the way to the damaged part.

Later on, I can make the ship semi-transparent and show which part is damaged.

cosmic zinc