Decals and oculus rift problem

hI,

I’m making some test with a scene to be displayed using Oculus Rift.
The scene is filled with various decals: I’ve placed deferred decals using a material with DBuffer blend mode because with other blend modes decals are visible only if hit by direct lighting.
Unfortunately, diplaying the scene with Oculus Rift, Dbuffer blend mode decals are visible only on one oculus eye.

This is an issue or I’m making something wrong?

I’m using unreal engine 4.1.1, I’ve also used unreal engine 4.2.1 without success.
Please help me, I need a solution

this is what I see when starting the game with Oculus:
9485-
This is the material I used on the deferred decal:
9486-

Howdy ciddi3d,

Thank you for your report. Would you be able to share the decal asset material so that we could further investigate the issue that you have been seeing? Could you also share your dxdiag?

Thanks and have a great a day!

How can I share material asset? I have to migrate the asset to another folder or export it as text file?

Hey ciddi3d,

If you find the folder in your Window Explorer, You should be able to drag the folder onto your desktop. After doing this, you can then right click the folder and highlight the Send To> option and click on Compressed (Zip) file. You should be able to send that as an attachment in a comment.

Thanks and have a great day!

here is the zip containing the graffiti material asset ( w/o the texture, 'cause it’s too big for posting :frowning: ).

link text

Hope this could help :slight_smile:

Hey ciddi3d,

Would setting your Decal Blend Mode to Translucent for the decal make the image appear in both eyes of the Oculus?

Howdy ciddi3d,

Than you again for your bug report. I have entered the bug into our database so that it may be further investigated.

Thanks and have a great day!

yes, in that case the decal appears on both eyes, but It disappears in the shadow (i.e. it is visible only if hit by direct lighting) :frowning:

Hey ciddi3d,

Thanks for clearing that up. That is a known issue where decals are not appearing when they are not in direct lighting. We have placed a single decal on the wall and moved the lighting so that the decal is half in the light and half in the shadow and only the lighted area was visible. This issue will be addressed in a future build.

Thanks and have a great day!

Our developers are still looking into this. It is JIRA #2941.

Hello,

I ran into this problem as well in 4.5.1, and was able to track the issue to the DBuffer clears in FRCPassPostProcessDeferredDecals::Process in PostProcessDeferredDecals.cpp:

SCOPED_DRAW_EVENT(RHICmdList, DBufferClear, DEC_SCENE_ITEMS);
{
	SetRenderTarget(RHICmdList, GSceneRenderTargets.DBufferA->GetRenderTargetItem().TargetableTexture, FTextureRHIParamRef());
	RHICmdList.Clear(true, FLinearColor(0, 0, 0, 1), false, 0, false, 0, FIntRect());
	SetRenderTarget(RHICmdList, GSceneRenderTargets.DBufferB->GetRenderTargetItem().TargetableTexture, FTextureRHIParamRef());
	// todo: some hardware would like to have 0 or 1 for faster clear, we chose 128/255 to represent 0 (8 bit cannot represent 0.5f)
	RHICmdList.Clear(true, FLinearColor(128.0f / 255.0f, 128.0f / 255.0f, 128.0f / 255.0f, 1), false, 0, false, 0, FIntRect());
	SetRenderTarget(RHICmdList, GSceneRenderTargets.DBufferC->GetRenderTargetItem().TargetableTexture, FTextureRHIParamRef());
	// R:roughness, G:roughness opacity
	RHICmdList.Clear(true, FLinearColor(0, 1, 0, 1), false, 0, false, 0, FIntRect());
}

The issue is that each of those calls to Clear() cleared the entire surface, so the right eye cleared the decals from the left eye. The solution is to add a call to SetViewport() after each call to SetRenderTarget():

SCOPED_DRAW_EVENT(RHICmdList, DBufferClear, DEC_SCENE_ITEMS);
{
	SetRenderTarget(RHICmdList, GSceneRenderTargets.DBufferA->GetRenderTargetItem().TargetableTexture, FTextureRHIParamRef());
	Context.SetViewportAndCallRHI(Context.View.ViewRect); // FIXES bug with no decals in left eye
	RHICmdList.Clear(true, FLinearColor(0, 0, 0, 1), false, 0, false, 0, FIntRect());
	SetRenderTarget(RHICmdList, GSceneRenderTargets.DBufferB->GetRenderTargetItem().TargetableTexture, FTextureRHIParamRef());
	Context.SetViewportAndCallRHI(Context.View.ViewRect); // FIXES bug with no decals in left eye
	// todo: some hardware would like to have 0 or 1 for faster clear, we chose 128/255 to represent 0 (8 bit cannot represent 0.5f)
	RHICmdList.Clear(true, FLinearColor(128.0f / 255.0f, 128.0f / 255.0f, 128.0f / 255.0f, 1), false, 0, false, 0, FIntRect());
	SetRenderTarget(RHICmdList, GSceneRenderTargets.DBufferC->GetRenderTargetItem().TargetableTexture, FTextureRHIParamRef());
	Context.SetViewportAndCallRHI(Context.View.ViewRect); // FIXES bug with no decals in left eye
	// R:roughness, G:roughness opacity
	RHICmdList.Clear(true, FLinearColor(0, 1, 0, 1), false, 0, false, 0, FIntRect());
}

I hope this helps,

Hey Beeson,

Thank you for the information. I will be sure to pass include this post in the Jira Report.

Have a great day!

Hi,

I’m working on an Oculus project too and I have the same problem. I’m using the 4.7.3 but I don’t know how to change the code of the engine and compile it. Can you help me ?

Hello robi2005,

I was unable to reproduce this issue on our end. I have a few questions for you that will help narrow down what issue it is that you are experiencing.

Quick questions:

  1. Can you reproduce this issue in a clean project?
  2. If so, could you provide a detailed list of steps to reproduce this issue on our end?
  3. Can you provide screen shots of how you have your material setup?

Sorry to answer so late but we were quite busy these last days.
We tried to change the PostProcessDeferredDecals.cpp but we still have the problem. Worst, we also don’t have any light on the left eye.

It’s begin to be a big project so I can’t provide you a list of what we exactly did but we still have the problem on a blank project.
We followed this tutorial for the decals : Decals not rendered without direct lighting? - Rendering - Unreal Engine Forums

Hello robi2005,

After doing a bit of digging I found that this is a known issue (UE-11849) and that it has been resolved internally. This solution will be available in a later release of the engine. I have provided two options below that may be able to resolve your issue. The first is a bit of code that a developer had changed to solve a similar issue. The other is the commit that was used for UE-11849. I hope that this helps.

In “SetupPrePassView” in “DeferredShadingRenderer.cpp”

change this:

RHICmdList.SetScissorRect(true, ViewRect.Min.X, ViewRect.Min.Y, ViewRect.Max.X, ViewRect.Max.Y);

to this:

RHICmdList.SetScissorRect(false, 0, 0, 0, 0);

The Commit:

https://github.com/EpicGames/UnrealEngine/commit/10f7131b928cb855b674eba17bfac3f249c26394

Make it a great day

We just install the last SDK from Oculus and we still have the same problem :confused:

Hello robi2005,

Please try one of the suggestions that was provided below. This issue should be resolved in the 4.8 version of the engine. If this is not the case please post back with any additional information.

(PLEASE NOTE: we do NOT suggest that develop your project in the preview version of the engine. Preview versions of the engine are considered unstable and are for testing out new potential features for the up and coming release)

Apologies Rudy, I didn’t see your answer D: I thought the reply will be after my last post so I didn’t check the top of the page …
We managed to solve the problem by changing the code, thanks a lot ! We’re waiting for the final version of the 4.8 to test if it works well but for now we can continue our work :smiley:

Hello robi2005,

I am happy to hear that you have things working! If the issue returns in 4.8 please be sure to update this thread with any new information that you have.

Make it a great day