About Store Forum Documentation Contact



Post Reply 
DirectX Device lost
Author Message
_MK_ Offline
Member

Post: #1
DirectX Device lost
since the last update i keep getting errors.

[Image: Error.png]

https://ibb.co/488HWWf

what can that be?
(This post was last modified: 08-23-2021 11:46 AM by _MK_.)
08-23-2021 11:42 AM
Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #2
RE: DirectX Device lost
Hello,

I don't think anything was changed about that.
Perhaps it's some problem with your system, are you on Win11?
You might want to check if you have latest GPU drivers updated, and that there are no updates being performed while Editor is running. If GPU driver is being updated in the background then you will get this error.

You could also try to check this code:
https://github.com/Esenthel/EsenthelEngi....cpp#L2310

and let me know what's the error code. value of 'present'
08-23-2021 12:26 PM
Find all posts by this user Quote this message in a reply
RedcrowProd Offline
Member

Post: #3
RE: DirectX Device lost
This error is not new though.

it did happen to me when the application start and you alt-tab at a certain time.

i do recall it being a thing about 2-3years ago
(This post was last modified: 08-23-2021 03:58 PM by RedcrowProd.)
08-23-2021 03:43 PM
Find all posts by this user Quote this message in a reply
_MK_ Offline
Member

Post: #4
RE: DirectX Device lost
I now have all drivers up to date but without success.

At steam there is the game Crossroad Inn, some people also have the error.
I mean the game was made with the engine, I think
https://steamcommunity.com/app/867290/di...090826199/

I also have strong pixelated dark artifacts at the moment. That with DOF and MotionBlur but only if everyone activates with High Precsion.

As I said the editor or whoever I am in the game runs for a certain time afterwards the error comes
08-24-2021 12:50 AM
Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #5
RE: DirectX Device lost
Hi, the link you've sent - engine codes were good, the problem was at directx/GPU drivers. Workaround was already implemented and solved the problem.
So your problem is different.
Could you please check my previous post and let me know what value of 'present' are you getting when the error occurs?
Are you on win11?

As for other error of pixelated dark artifacts. It would be best to attach a screenshot and a reproducible sample project.
Thanks
08-24-2021 06:03 AM
Find all posts by this user Quote this message in a reply
_MK_ Offline
Member

Post: #6
RE: DirectX Device lost
to my operating system that is Win 10 Home, and have a Geforce RTX 2080 SUPER

MotionBlur
[Image: image.png]
https://ibb.co/LZnM1Mj
DOF
[Image: 1.png]
https://ibb.co/xjCyTxT
Sharpen
[Image: 2.png]
https://ibb.co/2kdRNY8

I have to look because of the present. I haven't worked with the source code yet

It looks like there is a problem with the DriectX device lost for many of the RTX.

Overwatch and UE4 also have this problem. I'll post the link to the UE4 forum I hope that's not too bad
https://forums.unrealengine.com/t/unreal...ain/138376
(This post was last modified: 08-24-2021 12:16 PM by _MK_.)
08-24-2021 11:30 AM
Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #7
RE: DirectX Device lost
DirectX Device Lost - looks like it's some Windows/GPU Driver bugs.
As for the graphical glitches (black dots), if you send me your project I could test it manually.
As for sharpen looking totally wrong, that looks again like a Nvidia GPU driver bug.

https://github.com/GPUOpen-Effects/Fidel...ration.pdf
On page 28 there's mentioned image corruption with Nvidia GPU's
08-24-2021 04:07 PM
Find all posts by this user Quote this message in a reply
_MK_ Offline
Member

Post: #8
RE: DirectX Device lost
it looks like that with the black points with multi sampling is related to the combination with high precision.

I also tried it with my second pc with a Geforce 960 and it had the same effect.

With the error DirectX Device lost it is related to the graphics card, I hope that it will be fixed because the error has been occurring since last year
08-27-2021 06:10 PM
Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #9
RE: DirectX Device lost
Good news, I have a new computer.
Bad news, I have same problems like you.
Good news, I will can fix black spots.
Also investigating the DX device lost problem, let's see what happens - is using Parallax mapping instead of Relief mapping fixes crashes for you?
09-15-2021 03:45 AM
Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #10
RE: DirectX Device lost
The first step in fixing the black quads is:
-update to latest engine source from github which has fixed code for setting vtx normals on new/imported models
-to fix old models, make a new application in your project and use the following code, and run
Code:
/******************************************************************************/
Edit.EditorInterface EI;
Memc<Edit.Elm>       elms;
/******************************************************************************/
bool Check(C Edit.Elm &elm)
{
   bool changed=false;
   switch(elm.type)
   {
      case Edit.ELM_MESH:
      {
         Mesh mesh; if(EI.getMesh(elm.id, mesh))
         {
            FREPD(l, mesh.lods())
            {
               MeshLod &lod=mesh.lod(l); FREPAD(p, lod)
               {
                  MeshPart &part=lod.parts[p];
                  MeshBase &base=part.base;
                  FREPAD(v, base.vtx)
                  {
                   C Vec &n=base.vtx.nrm(v);
                     if(!Equal(n.length(), 1))
                     {
                        MeshBase temp(base, VTX_POS|FACE_IND); temp.setNormals(); // copy to a temp mesh and set its vtx normals
                        if(base.vtxs()==temp.vtxs() && temp.vtx.nrm()) // safety checks
                        {
                           changed=true;
                           REPA(base.vtx)
                           {
                              Vec &nrm=base.vtx.nrm(i); if(!Equal(nrm.length(), 1)) // if any 'base' vtx normal is wrong
                              {
                                 nrm=temp.vtx.nrm(i); // copy from 'temp'
                              }
                           }
                        }
                        break;
                     }
                  }
               }
            }
            if(changed)EI.setMesh(elm.id, mesh);
         }
      }break;
   }
   return changed;
}
/******************************************************************************/
void InitPre()
{
   EE_INIT();
   App.y=-1;
   App.flag|=APP_MINIMIZABLE|APP_MAXIMIZABLE|APP_RESIZABLE;
   D.mode(720, 384).scale(1.4);
#if DEBUG
   App.flag|=APP_MEM_LEAKS|APP_BREAKPOINT_ON_ERROR;
#endif
}
bool Init()
{
   Materials.mode(CACHE_ALL_DUMMY);
   Enums.mode(CACHE_DUMMY);

   Str msg; if(!EI.connect(msg))Exit(msg);
   if(!EI.getElms(elms))Exit("EI.getElms");

   int fixed=0; FREPA(elms)fixed+=Check(elms[i]);
   Exit(S+"Fixed: "+fixed+" meshes");
   return true;
}
void Shut()
{
}
/******************************************************************************/
bool Update()
{
   if(!App.active())Time.wait(1);
   if(Kb.bp(KB_ESC))return false;
   Gui.update();
   return true;
}
void Draw()
{
   D.clear(AZURE);
   Gui.draw();
}
/******************************************************************************/
This will fix your mesh vertex normals, in case some of them are (0,0,0) which might generate NaN in the shader.

I will do more tests, and get back to you.
09-15-2021 03:50 PM
Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #11
RE: DirectX Device lost
Great news, I've fixed both problems.
There should be no black quads, and no DirectX Device Lost.
Please update to latest engine version from GitHub.
09-17-2021 05:34 PM
Find all posts by this user Quote this message in a reply
Fluxor Offline
Member

Post: #12
RE: DirectX Device lost
Oh, very cool! Had the same (device lost) problem yesterday
for the first time ever on my win machine.
So this probably helps here as well.
(This post was last modified: 09-17-2021 08:36 PM by Fluxor.)
09-17-2021 08:36 PM
Find all posts by this user Quote this message in a reply
_MK_ Offline
Member

Post: #13
RE: DirectX Device lost
Thank you very much, I'm really glad that the problems have been resolved
09-19-2021 02:57 PM
Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #14
RE: DirectX Device lost
Also I've just added a workaround for EASU and Sharpen for GeForces.
09-19-2021 05:12 PM
Find all posts by this user Quote this message in a reply
Post Reply