Announcement

Collapse
No announcement yet.

Is this possible

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • replied
    Originally posted by Arnage View Post
    Math is quite predictable, so trial and error is not necessarily required
    Oh you are absolutely right, but in my case i'm sure there will be a lot of trial and error involved

    Originally posted by Arnage View Post
    One additional advantage of this method is that you can easily add other effects such as foam or waves near the sub in a more exact way then the common depth based methods would allow.
    Yes, i have so many ideas that this technique will allow me to do, also i have noticed that viewed from the interior the mask doesn't have to be extremely precise for the effect to look right so this is even more reassuring

    Are there any good resources out there where i could learn how to create mathematical shapes in the material editor?

    Leave a comment:


  • replied
    Glad to have helped.

    Originally posted by KhenaB View Post
    I want to give your method a try, what would be the easiest way to calculate the bounds of each parts of the object, the sphere shape seems quite simple but let's say the helmet isn't perfectly round, would this have to be an equation done in the material editor with trial and error until the mask matches the mesh?
    Math is quite predictable, so trial and error is not necessarily required But yeah, if you need another shape you would have to adjust the math to approximate that shape. Also keep in mind that for other shapes you have to consider the objects rotation in addition to the location.

    One additional advantage of this method is that you can easily add other effects such as foam or waves near the sub in a more exact way then the common depth based methods would allow.

    Leave a comment:


  • replied
    This is what i got so far with your technique Arnage, it feels good to have it working dynamically, this is looking very promising

    Leave a comment:


  • replied
    Ah, i'm familiar with parameters, i work with material instances, for some reason i had forgotten parameters can be accessed in blueprint

    I want to give your method a try, what would be the easiest way to calculate the bounds of each parts of the object, the sphere shape seems quite simple but let's say the helmet isn't perfectly round, would this have to be an equation done in the material editor with trial and error until the mask matches the mesh?

    Leave a comment:


  • replied
    Originally posted by KhenaB View Post
    Arnage, interesting, while this seems a bit limited with the shape i could give it a try and model the diving suit/submarine for this to work well enough, you mention "transfer the center location and radius of the sub's glass sphere", i see that you use a constant4 for the location, would this work only for a static mesh our could this location be dynamic?
    Those aren't constants, they're parameters. Which you can easily update from a blueprint to make the hole follow the location of the sub.

    You are indeed constraint a bit with the shape. However, you only need the transparent parts to line up, if you have opaque hull parts the edge just needs to end up somewhere inside the thickness of the hull, which should allow for some more freedom in shape. Additionally you can also use some extra instructions to create a more complex shape.

    Leave a comment:


  • replied
    Jacky, i'd like to hear more about your suggestion, are you saying that i should calculate the scene depth in order to know the distance between the camera and the submarine mesh from the inside and mask that out?

    This will all take place from the interior only and the vehicle will be dynamic

    Leave a comment:


  • replied
    Thank you so much Jacky and Arnage for the suggestions this is really appreciated

    I have thought about masking the object through the water material directly, i was trying to find a way to calculate the bounds of the object and send that to the opacity but i couldn't figure it out, if only there was a way to calculate the bounds and transform of the shape and sent that to the material

    Arnage, interesting, while this seems a bit limited with the shape i could give it a try and model the diving suit/submarine for this to work well enough, you mention "transfer the center location and radius of the sub's glass sphere", i see that you use a constant4 for the location, would this work only for a static mesh our could this location be dynamic?

    Thanks again

    Leave a comment:


  • replied
    Another approach would be to handle this inside the water material. If you transfer the center location and radius of the sub's glass sphere you can easily calculate the area that needs to be masked.

    Click image for larger version

Name:	OceanMasking.jpg
Views:	1
Size:	147.4 KB
ID:	1064295

    Pros:
    - Cheap
    - Works in all cases (inside, outside, etc.)
    - Works with both transparent and opaque materials.
    - Same method works for your particles and other stuff that should not show up inside

    Cons:
    - You have to know the number of objects that can cause masking ahead of time and each one will adds a few instructions to the shader (so only use it if you have a small number of "hero" objects)
    - Only works with shapes that can be easily mathematically defined (spheres, capsules, boxes, etc.)

    Leave a comment:


  • replied
    Pixeldepth or Scenedepth opacity masking in the material may be a solution for when you are inside the submarine or the diving suit.

    Leave a comment:


  • replied
    It should, also the boat is not my main concern as i can easily avoid it by tweaking the buoyancy, i used the penetrating wave scenario as an example

    The main concern is really having a submarine or a diving suit going underwater and not having the water surface, fog and particles inside the vehicle

    Leave a comment:


  • replied
    That's ok for the boat though right?

    Leave a comment:


  • replied
    I have managed to get this effect but as you can see all the water gets blocked behind the glass sphere and not just inside of it, also it wouldn't have worked if my water plane wasn't translucent

    Why do i always pick the complicated stuff

    Click image for larger version

Name:	Glassbubble.jpg
Views:	1
Size:	256.1 KB
ID:	1064287

    Leave a comment:


  • replied
    Thanks for your help, really appreciated

    Leave a comment:


  • replied
    You can start from here: https://docs.unrealengine.com/latest...als/index.html

    Can't help you more though, never done this before.

    EDIT:
    Tom Looman (also posts on this forums) might be able to help you since he's done similar custom depth materials. example:
    http://www.tomlooman.com/the-many-us...h-in-unreal-4/
    Last edited by Errvald; 12-18-2014, 08:11 PM.

    Leave a comment:


  • replied
    Thanks Errvald, very interesting suggestion

    I have never done anything like that before so i'll have to do some looking around, let me know if you have interesting links

    Leave a comment:

Working...
X