Questions in topic: "depth"https://answers.unrealengine.com/questions/topics/single/16736.html
The latest questions for the topic "depth"Making character render on top of anotherhttps://answers.unrealengine.com/questions/865304/making-character-render-on-top-of-another.html
Hi i spent a lot of time looking for an answer for this.
i am making a 2.5D fighting game and i want the character who landed the last hit to be rendered on the top of the other.
i noticed that it's been done on UE4 games like Street Fighter V and Dragon Ball FighterZ.
I tried changing the material to translucent but it flipped the character inside out.
and for now i am just stuck with custom depth and post processing that's rendering solid colors and outlines in overlapped points.rendercustom depthdepthfighting gamedepth testSun, 13 Jan 2019 02:58:31 GMTComic ShakeCapture Custom Stencil with Capture2Dhttps://answers.unrealengine.com/questions/844910/capture-custom-stencil-with-capture2d.html
Hey! I was wondering if capturing the custom stencil value of objects was possible with a Capture2DComponent.depthstencilcapture2dThu, 08 Nov 2018 03:25:29 GMTZeclownAndroid Pie's dual camera features in Unrealhttps://answers.unrealengine.com/questions/835795/android-pies-dual-camera-features-in-unreal.html
I would like to access both cameras on an android device in unreal. But I'm not sure how.
Android Pie added multi-camera APIs which allow developers to access both cameras and even create depth images.
How am I able to use these features inside a game?
Should I do this with a custom plugin? I read about jni and that it would allow developers to call java/android functions.
Thanks in advance! Any help is appreciatedcameradepthandroid sdkstereojniTue, 09 Oct 2018 12:49:34 GMTWardVanBeverSceneCapture Depth as Texturehttps://answers.unrealengine.com/questions/830086/scenecapture-depth-as-texture.html
Hi, I want to get a depth map from a specific view. And I want it as texture because I want to be able to access the data in C++.
So I did the following setup. I placed a SceneCapture2D in the view I want. In the rendering settings it should render the scene into rgb and the depht into a-channel of a rendertarget:
![alt text][1]
When It take a look at the render target, the rgb channels are good:
![alt text][2]
but the alpha channel does not contain any depth map - it´s just white:
![alt text][3]
Am I doing something wrong? Or is there another way to do this?
Thanks in advance!
[1]: /storage/temp/254214-testsetup-scenecapturesetup.jpg
[2]: /storage/temp/254215-testsetup-bodyrgb.jpg
[3]: /storage/temp/254216-testsetup-bodyalpha.jpgscene capturerender targetdepthrender texturedepth textureThu, 20 Sep 2018 13:39:58 GMTDaKenpachi4.20 broke my Depth Bufferhttps://answers.unrealengine.com/questions/824902/420-broke-my-depth-buffer.html
## Edit##
Turns out it's a bug! Check [UE-64034][1] for progress on a solution. Thanks to everyone who helped me.
## TL;DR ##
Unreal's renderer has been corrupted for me since 4.20 released. I *suspect* that there's something wrong with my depth buffer. Here's what the depth buffer looks like before and after entering VR.
![alt text][2]
## In Detail ##
Sooo after updating to Unreal Engine 4.20 I've been having some issues making VR content.
Whenever I enter VR **everything** Unreal renders gets corrupted (even thumbnails!). Eventually I figured out that the scene depth buffer get messed up by entering VR. To fix this I can restart UE or take a 'High Resolution Screenshot'.
Best of all: Everything is fine in UE 4.19, and the preview builds of 4.20 also worked flawlessly. Some change in 4.20 probably broke my depth buffer.
At this point I've tried pretty much everything except for replacing my graphics card and reinstalling Windows.
**I'd be happy about any suggestions! :]**
## Things I've tried ##
-Creating an empty project
-Reinstalling UE 4.20
-Updating my graphics card driver
-Rolling back my graphics card driver
-Deleting all sorts of derived data caches
-Making posts on the forum, the Answerhub, Reddit, the Unreal Slackers Discord, ...
-Not using DirectX (Actually works, but Vulkan and OpenGL crash frequently.)
-Using the forward renderer, using instanced stereo
Here's my DxDiag. [https://pastebin.com/raw/a8pEGRVj][3]
[And here's an image of the renderer overview: Click me][4]
## Have I missed anything? Any comments appreciated! ##
[1]: https://issues.unrealengine.com/issue/UE-64034
[2]: /storage/temp/252684-depthbufferaftervr.png
[3]: https://pastebin.com/raw/a8pEGRVj
[4]: https://answers.unrealengine.com/storage/attachments/252685-rendereroverview.pngrenderingvrpreviewdepthcorruptedTue, 04 Sep 2018 13:22:55 GMTdaaltaHow to test scene depth against custom depth in a post process materialhttps://answers.unrealengine.com/questions/823702/how-to-test-scene-depth-against-custom-depth-in-a.html
I'm working on a game which involves a big "kill-sphere" and I want to do a custom-depth effect so that everything outside of the sphere is orange. I have partly achieved this but since custom depth doesn't test against scene depth, the sphere appears to be visible through the floor. Hopefully the pictures better demonstrates this.
![stop lookin at the text!!!][1]
![look at the picture dummy][2]
[1]: /storage/temp/252239-stormbug02.png
[2]: /storage/temp/252238-stormbug01.pngmaterialspost processcustom depthdepthFri, 31 Aug 2018 18:24:59 GMTcorizeus4.20.2 Stencils & CustomDepth not workinghttps://answers.unrealengine.com/questions/823528/4202-stencils-customdepth-not-working.html
4.20.2 stencils and custom depth does not work if called with c++ or blueprints. Only works if directly set in the editor.renderingue4customdepthstencilFri, 31 Aug 2018 09:32:29 GMTSreeraghgetting the value of depth for each pixel each framehttps://answers.unrealengine.com/questions/805805/getting-the-value-of-depth-for-each-pixel-each-fra.html
how do i get the depth in c++ code if possible of each pixel each frame and then normalise the answerdepthThu, 05 Jul 2018 16:16:14 GMTLiam0Nealescene capture2d depth not capture translucent？https://answers.unrealengine.com/questions/799099/scene-capture2d-depth-not-capture-translucent.html
I tryed scenedepth in A,and in General show Flags translucency is turn on,but depth map don't have translucent model.scene capturedepthTue, 12 Jun 2018 03:35:02 GMTquietle0000Custom Stencil to manipulate render order?https://answers.unrealengine.com/questions/782029/custom-stencil-to-manipulate-render-order.html
I have a simple playing card mesh with some UI-domain materials applied to different sections. This allows for some WidgetComponents to be added with dynamic text and effects applied directly to the card. However, the project utilizes an explorable 3D environment, and can sometimes lead to our 3D card meshes clipping/colliding with other nearby meshes (i.e: pillars, columns, rocks, etc).
After a few weeks of trying various methods (i.e: USceneCaptureComponent2D, UViewport widget, etc), it has come to my attention that perhaps the answer to rendering these cards "on top" of the environment is to utilize a custom stencil pass. But this is the best result I could achieve:
![alt text][1]
![alt text][2]
It would seem that occluded part of the mesh is not rendered (or rather, the checkered wall is rendered over it). Is there any way to simply have the mesh render on top? Any engine source changes I could make to enforce a particular rendering order?
[1]: /storage/temp/238435-material.png
[2]: /storage/temp/238434-beforeandafter.pngc++renderingdepthorderstencilSun, 22 Apr 2018 12:07:23 GMTMichaelWionCapture Depth from Render Targethttps://answers.unrealengine.com/questions/764696/capture-depth-from-render-target.html
How/can I capture the depth buffer from a SceneCapture2D to a RenderTarget to use in a material?
Simplest example would be: I want a security camera rendering on a material that doesn't display RGB, but instead displays depth from the camera. Like a Kinect.depthrendertargetFri, 02 Mar 2018 22:02:07 GMTGavin.KistnerHow to fix depth artifacts with Scene Capture Component 2D?https://answers.unrealengine.com/questions/750697/how-to-fix-depth-artifacts-with-scene-capture-comp.html
I'm trying to render a heightmap to a render texture using an orthographic Scene Capture Component 2D placed above the scene. However, unless I crank up the render target resolution up to 4K (which requires 600+MB of VRAM for 32-bit floats), I get terrible artifacting for the Scene Depth.
Consider this 1K heightmap texture (scaled down to visible range):
![alt text][1]
Compared to this 4K (downsampled to 1K) heightmap:
![alt text][2]
It's pretty clear to see the artifacts in the 1K version.
I really can't think of any logical reason for this.
Further notes that could be helpful are that I'm using Forward Rendering, because this is a VR project, and the orthographic width is 100000. The Scene Capture Component 2D is 5000-15000 unit above the landscape surface.
The bright part is where the landscape clips through the capture component, but those aren't important for my purposes.
[1]: /storage/temp/228255-artifacts.png
[2]: /storage/temp/228256-correct.pngscene capturerender targetartifactsdepthWed, 24 Jan 2018 14:12:22 GMTnovacrazysceneDepth vignettinghttps://answers.unrealengine.com/questions/745395/scenedepth-vignetting.html
Hi,
We are using UE4.16 for a science project and need to extract sceneDepth, however it seems sceneDepth exhibits some vignetting on the edges of the screen.
I've reproduced this problem in a clean project based on the Flying template. The only modifications I made are:
- I created a post process material as shown in the screenshot
- I applied this material to a Post Process Volume.
Material screenshot:
![alt text][1]
Then I've positioned a camera facing a wall perpendicularly, created a screenshot and then rotated it (without any translational) movement and made another screenshot. The distance between the camera and any point on the wall should, therefore, be the same in both screenshots.
Real render of the screen (for representation):
![alt text][2]
However, I've measured the color values of the same spot on the wall and they are quite different. As my depth material is from white to black (with white meaning close and black meaning far), the color of the same spot is much darker when it's at the edge of the screen.
![alt text][3]
![alt text][4]
To make this problem more apparent I imported the screenshots to Photoshop and increased contrast.
Can anyone please confirm this is the case with sceneDepth node and any possible solution?
Thanks!
[1]: /storage/temp/226660-180111-ppdepthmaterial.png
[2]: /storage/temp/226673-180111-depthmapvignettinganalysis-real.jpg
[3]: /storage/temp/226671-180111-depthmapvignettinganalysis-lighter.jpg
[4]: /storage/temp/226672-180111-depthmapvignettinganalysis-darker.jpgrenderingdepthscenedepthThu, 11 Jan 2018 07:23:25 GMTmitjaprelovsekBullet holes?https://answers.unrealengine.com/questions/743803/bullet-holes-1.html
So I'm trying to add depth to this bullet hole material that changes based on wherever the player shoots and I can't use parallax occlusion because it's not a static image
![alt text][1]
Based on this tutorial https://www.youtube.com/watch?v=GXbE0IqbA7w&feature=youtu.be&t=1404
[1]: /storage/temp/226212-ue4editor-2018-01-06-18-10-02.pngmaterialdepthbulletSun, 07 Jan 2018 00:18:34 GMTdeathclonicLocation Based Opacity with intersection fillerhttps://answers.unrealengine.com/questions/738142/location-based-opacity-with-intersection-filler.html
Hi, everyone!
I've managed to reproduce **[this tutorial][1]**.
But (because my knowledge of shaders is very poor) I can't get the result what I want.
How it is now:
![alt text][2]
What I want:
![alt text][3]
How can I achieve it?
[1]: https://wiki.unrealengine.com/Location_Based_Opacity_in_UE4_-_Part_1
[2]: /storage/temp/224501-how-it-is.png
[3]: /storage/temp/224502-what-i-want.pngmaterialsshaderopacitydepthoutlineWed, 20 Dec 2017 08:45:34 GMTHorokeyScene Depth capture does not workhttps://answers.unrealengine.com/questions/723922/scene-depth-capture-does-not-work.html
When using Capture Source: Scene Depth in a Scene Capture Component it is always just rendering plain red and nothing else, no matter what. It also appears someone forgot to add any range settings for it.bug reportrenderdepthThu, 09 Nov 2017 18:07:52 GMTDavisionCustom Render Depth Failinghttps://answers.unrealengine.com/questions/721127/custom-render-depth-failing.html
I want my meshes to highlight when I mouse over them. It is a Point and Click game with Blueprinted mesh objects. The Post Process Volume is unbound and covering the entire room.
I'm attempting to adapt the [obsolete YouTube tutorial][1] by Tesla Dev.
To do this I have replaced the reference to **M_Highlighted.uasset** in the old Example Content to **M_Orange_Shiny_Highlighted.uasset**.
Also, as there is no longer a Misc tab in the details of Post Process Volume, I am assigning the material in **Rendering Features/Post Process Materials/Array**.
Nothing is happening. Can anyone help me get this going please?
----------
*Image of Post Process Volume Settings; \\//*
![alt text][2]
*Image of Nodes in Mesh Object Blueprint; \\//*
![alt text][3]
[1]: https://www.youtube.com/watch?v=j8gjvKyaQuU
[2]: /storage/temp/218715-ppv.png
[3]: /storage/temp/218716-nodes.pngmaterialsrenderingpost processdepthoutlineWed, 01 Nov 2017 18:34:40 GMTPeeeeeetSimulate depth camera. Depth settings not working as expectedhttps://answers.unrealengine.com/questions/719416/simulate-depth-camera-depth-settings-not-working-a.html
Hi
I'm trying to simulate a depth camera.
After some research I found that this should be possible with a ASceneCapture2D object and set CaptureSource to SCS_SceneDepth or SCS_DeviceDepth.
Following [this post][1] SCS_SceneDepth should output values in cm, but I get values in [0,1].
The calculation with SCS_DeviceDepth seems to work (but alpha is always 1).
I setup the TextureTarget as following:
renderTarget = UCanvasRenderTarget2D::CreateCanvasRenderTarget2D(GetWorld(), UCanvasRenderTarget2D::StaticClass(), PictureResolutionX, PictureResolutionY);
renderTarget->bHDR = 1;
renderTarget->InitAutoFormat(PictureResolutionX, PictureResolutionY);
And read the pixels in the FLinearColor struct.
If I read the red value of a SCS_SceneDepth pixel I get values in [0,1] on the contrary to the promised cm values.
This wouldn't be a problem by itself, but the [0,1] values from SCS_SceneDepth (and also from SCS_DeviceDepth) don't seem to be linear, so I don't know how to convert them back to cm values.
As I'm trying to simulate a max range on the camera this is a problem. I need to scale the values that the colors white to black map linear from 0cm to e.g. 350cm.
I tried to make some measurements with accurately placed planes and discovered an other problem. The cm range behind the [0,1] values do not seem to be static. If a plane fills the whole field of view the values get rescaled so that the planes is displayed in white.
----------
So my Questions are:
1. How to I read the cm values from a SCS_SceneDepth pixel?
2. As I would like to have the best possible precision. How to i convert the [0,1] values back to cm?
3. And last how do I prevent the above described rescaling?
----------
Thanks for any information to my questions. I found near to nothing to this topic that seems to work and site like [this][2] are not helping at all.
[1]: https://answers.unrealengine.com/questions/708727/what-does-devicedepth-option-under-scenecapturecom.html
[2]: https://docs.unrealengine.com/latest/INT/Engine/Rendering/Materials/ExpressionReference/Depth/index.html#scenedepthscenecapture2ddepthscenecapturecomponent2dscenedepthFri, 27 Oct 2017 10:18:06 GMTLuzemAll translucent materials look posted on the screen in Android Devicehttps://answers.unrealengine.com/questions/718229/all-translucent-materials-look-posted-on-the-scree.html
Hi, this is an issue only for Android device(I don't test IOS device). The problem is, in Android device (my SDK version is 23 and Android version is 7.1.1), all of my static mesh with translucent materials look posted on the phone screen.
Here I have some snaps:
My character's materials are absolutely opaque and materials of glass here are translucent. Rendering in Android looks like these.
![alt text][1]
![![alt text][2]
Still the opaque character and the translucent materials on the ground here:
![alt text][3]
This is a translucent frame in the universe:
![alt text][4]
All of above problems are only in Android. Everything is okay in Unreal Editor. Can anyone helps me where the problem is. Android? Rendering problem? Depth or Post Progress? Or just some setting for materials?
[1]: /storage/temp/217691-4.png
[2]: /storage/temp/217693-2.png
[3]: /storage/temp/217694-3.png
[4]: /storage/temp/217695-1.pngmaterialsrenderingandroiddepthMon, 23 Oct 2017 20:39:35 GMTpcjjdyForward rendering and pixel depth offsethttps://answers.unrealengine.com/questions/716561/forward-rendering-and-pixel-depth-offset.html
Hi,
I have a plane facing my camera for which I use the "pixel depth offset" node in order to set the depth. With the deferred renderer I have lighting and shadows on my plane but when I switch to forward, my plane is totally shadowed when I look at a shadow and I don't have any other light.
I tried to edit the "BasPassPixelShader.usf" code which seems to use the depth of the plane and not the depth + offset. But the only thing I got is a grid of shadows, and I still can't see the lights.
Is this a limitation of the forward renderer or is there a fix ?lighting problemdepthforward renderingWed, 18 Oct 2017 09:44:11 GMTkeiko_Is there a way to push billboard geometry twords camera?https://answers.unrealengine.com/questions/714952/is-there-a-way-to-push-billboard-geometry-twords-c.html
I can find any feature to offset billboard geometry twords camera or offset render depth of a translucent billboard. I can find any feature for somthing like this? Am I doing something wrong? The feature to offset billboad geometry seems simple, and could be very helpfull.depthbillboardrender orderThu, 12 Oct 2017 13:25:14 GMTMikiokCustom depth for pawn camerahttps://answers.unrealengine.com/questions/713006/custom-depth-for-pawn-camera.html
Greetings,
using a custom depth and PP material to show pipework though the landscape and building, it works just fine for the default pawn but it wont work on my aerial camera pawn, just shows a solid color over the view, do cameras not render custom depth?
![alt text][1]
![alt text][2]
[1]: /storage/temp/215823-arielpawn.jpg
[2]: /storage/temp/215822-defaultpawn.jpgrenderingcameracustomdepthThu, 05 Oct 2017 23:33:35 GMTRaredenScene Depth not available when SceneCapture2D is turned 180-degreehttps://answers.unrealengine.com/questions/711607/scene-depth-not-available-when-scenecapture2d-is-t.html
We are seeing very strange behavior. We use "Camera Relative Position World" node in material on SceneCapture2D component to get the depth view of the scene and render it in left most sub-window as shown below:
![alt text][1]
This works well in different environment except in one environment when we turn the SceneCapture2D 180-degree around and then see blank:
![alt text][2]
So basically, when we turn SceneCapture2D around, it still can capture visual scene but depth is suddenly all 0.
Any idea why this could be happening?
[1]: /storage/temp/215353-frontback.png
[2]: /storage/temp/215354-back.pngscenecapture2ddepthSun, 01 Oct 2017 09:34:26 GMTsytelusWhat does DeviceDepth option under SceneCaptureComponent2D capture?https://answers.unrealengine.com/questions/708727/what-does-devicedepth-option-under-scenecapturecom.html
I find the depth values to be wrapped between 0.0 to 1.0 as bands. And this wrapping is different for each of the RGB channels of the DeviceDepth captured.
How can I get the absolute depth value in UE4?scenecapture2ddepthscenecapturecomponent2dexrFri, 22 Sep 2017 13:24:47 GMTpradeepkumaridRender 3D widget on top of everything but characterhttps://answers.unrealengine.com/questions/665799/render-3d-widget-on-top-of-everything-but-characte.html
Hello!
I have an actor which is just a static mesh and a 3d widget component that always faces the camera. The problem is that the widget is sometimes occluded by nearby objects (see pic 1). I could use screen space instead of world space, but if I do so the UI will be rendered on top of my character as well (pic 2), and that's definitely not what I want. So I was wondering if there's any way to do something like a mixture of both world and screen space, and render the widget on top of everything but my character.
After a bit of reading I've come to the conclusion that this could be done using custom depth and post process materials, but I'm definitely not skilled enough at that stuff to get there by myself, so was hoping someone would enlighten me a little bit about how to do it.
Thanks in advance!
![picture 1][1]![picture 2][2]
[1]: /storage/temp/192903-pic001.png
[2]: /storage/temp/192904-pic002.pngwidgetdepthrender orderMon, 31 Jul 2017 11:48:07 GMTMyIvoryTowerSceneCaptureComponent2D set to "scene depth in r" still records translucencyhttps://answers.unrealengine.com/questions/676601/scenecapturecomponent2d-set-to-scene-depth-in-r-st.html
I believe that this is unintended behaviour since translucent materials do not write to the depth buffer and thus have absolutely no effect on the resulting texture. Making it skip the translucent materials when set to a depth only mode could give a significant performance increase if a lot of translucent materials are in use.performancedepthtranslucent materialscenecapturecomponent2dSun, 30 Jul 2017 20:35:07 GMTBen_gAccess violation - code c0000005 (first/second chance not available)https://answers.unrealengine.com/questions/660932/access-violation-code-c0000005-firstsecond-chance-19.html
Hey, i got an error with code of c0000005 (first/second chance not available). When I look at log reports i decided to its related with RenderCustomDepth error. Thats happening when I'm playing over 4,5 mins later.
I have a method on Event Tick which called CheckForInteractable. I'm invoking this method on my Event Tick and in this method i get a component with using raytracing and changing CustomDepth of StaticMeshComponent.
Crash Reporter Log -> https://paste.ubuntu.com/24988889/
(FirstPersonCharacter.cpp) CheckForInteractable Method -> https://paste.ubuntu.com/24988995/
(Pickup.cpp) -> https://paste.ubuntu.com/24989009/c++editorcrashrenderingdepthFri, 30 Jun 2017 13:16:46 GMTKhuburRendering objects sharing the same location as if they were on top of each other - how to do it?https://answers.unrealengine.com/questions/660127/rendering-objects-sharing-the-same-location-as-if.html
I'm about to create a simple shmup game. To manage their interactions, I need to have three types of objects: background, enemies and player ship. I need them to be on the same height (no matter reasons for now).
What my problem is: I need to manage the objects so that they can share the same location (i.e. enemy and a player ship), but be rendered as if one is on top of each other. It's presented in the pictures attached:
Picture one - that's how the objects should be located (sharing the same place).
![alt text][1]
Picture two - that's how they should be visible in the game
![alt text][2]
Is such setup possible in UE4? in before: I need all the objects to be rendered in full materials and textures, with other effects on them, so I think the "custom depth" won't work in this case.
It'd be great if it can be achieved in blueprints exclusively (I'm not good at programming).
[1]: /storage/temp/191217-1.png
[2]: /storage/temp/191218-2.pngblueprintsdepthlayersrender ordershmupSun, 25 Jun 2017 06:22:14 GMTTenebraela PostProcess material that reacts to camera distance and a surface distancehttps://answers.unrealengine.com/questions/659802/a-postprocess-material-that-reacts-to-camera-dista.html
I want to make a PostProcessMaterial to use on my camera to generate a kind of fog.
essentially there is a surface. In the simple case its a plane but later it might be a more complex surface.
Everything in front of the surface will have a blue fog, and behind an orange fog. Clearly the camera will see a mix of the two fogs.
I can create a fog from the Object to the camera by enableing the ScenTexture:ScenDepth or the distance from CameraPostionWS t WorldPosition and creating a PostProcess Material that uses that depth to lerp between fog color and scene color. But I am not sure how to get either the distance from the object/pixel to the surface or the distance from the camera to surface along ray that the camera is seeing the scene pixel.
Are there any strategies for implementing this kind of material?
My Camera will always be out side of the surface.
![alt text][1]
[1]: /storage/temp/191097-cameraobjectsurface.pngmaterialsdepthpostprocessingThu, 22 Jun 2017 14:39:04 GMTaspartamedHow can I customise quad depth testing?https://answers.unrealengine.com/questions/657952/how-can-i-customise-quad-depth-testing.html
I have some very simple billboard sprites that I'm mixing with some simple 3D polygonal terrain.
I have some cliffs that are near the sprites. Currently when the sprites are too close, they clip into the terrain, like the diagram below.
What I'd like to happen is for them to "pop" so they're either **completely in front of or completely behind other meshes**, whether that's other billboard sprites, or pieces of the ground/cliffs. Probably based on the world position of the bottom-center of the billboard sprite, compared against some part of the other mesh..?
**Is there a way of achieving this?** As far as my limited graphics knowledge goes, it seems it's impossible... is there a way?
![alt text][1]
[1]: /storage/temp/190495-depthtesting.jpgspritesdepthbillboarddepthbufferz-orderMon, 12 Jun 2017 11:47:48 GMTbenhumphreys