ryzom / ryzomcore

Ryzom Core is the open-source project related to the Ryzom game. This community repository is synchronized with the Ryzom Forge repository, based on the Core branch.
https://wiki.ryzom.dev
GNU Affero General Public License v3.0
341 stars 90 forks source link

Ring decals not showing under OpenGL #592

Open kaetemi opened 4 years ago

kaetemi commented 4 years ago

Not working under OpenGL. (Shows faint outline on the rectangle border of the texture.) image

Works fine on Direct3D. image

kaetemi commented 4 years ago

@kervala Any idea?

kaetemi commented 4 years ago

Call stack for rendering decal on Direct3D

    nel_drv_direct3d_win_d.dll!NL3D::CDriverD3D::renderPrimitives(_D3DPRIMITIVETYPE primitiveType, unsigned int __formal, NL3D::CMaterial & mat, unsigned int firstVertex, unsigned int nPrims) Line 84 C++
    nel_drv_direct3d_win_d.dll!NL3D::CDriverD3D::renderRawTriangles(NL3D::CMaterial & mat, unsigned int firstIndex, unsigned int numTris) Line 281  C++
>   ryzom_client_dev_d.exe!CDecal::renderTriCache(NL3D::IDriver & drv, NL3D::CShadowPolyReceiver & __formal, bool useVertexProgram) Line 422    C++
    ryzom_client_dev_d.exe!CDecal::render(NL3D::UDriver & __formal, NL3D::CShadowPolyReceiver & receiver, const std::vector<NLMISC::CPlane,std::allocator<NLMISC::CPlane>> & worldPyramid, const std::vector<NLMISC::CVector,std::allocator<NLMISC::CVector>> & pyramidCorners, bool useVertexProgram) Line 606 C++
    ryzom_client_dev_d.exe!CDecalRenderList::renderAllDecals() Line 654 C++
    ryzom_client_dev_d.exe!CLandscapePolyDrawer::renderLandscapePolyPart() Line 316 C++
    ryzom_client_dev_d.exe!drawRenderScene(bool wantTraversals, bool keepTraversals) Line 764   C++
    ryzom_client_dev_d.exe!doRenderScene(bool wantTraversals, bool keepTraversals) Line 787 C++
    ryzom_client_dev_d.exe!mainLoop() Line 1742 C++
kaetemi commented 4 years ago

mat


  | Name | Value | Type
-- | -- | -- | --
  | _ShaderType | Normal (0) | NL3D::CMaterial::TShader
  | _Flags | 896 | unsigned int
  | _SrcBlend | srcalpha (2) | NL3D::CMaterial::TBlend
  | _DstBlend | invsrcalpha (3) | NL3D::CMaterial::TBlend
  | _ZFunction | lessequal (5) | NL3D::CMaterial::ZFunc
  | _ZBias | -0.0599999987 | float
▶ | _Color | {R=255 'ÿ' G=255 'ÿ' B=255 'ÿ' ...} | NLMISC::CRGBA
▶ | _Emissive | {R=0 '\0' G=0 '\0' B=0 '\0' ...} | NLMISC::CRGBA
▶ | _Ambient | {R=0 '\0' G=0 '\0' B=0 '\0' ...} | NLMISC::CRGBA
▶ | _Diffuse | {R=0 '\0' G=0 '\0' B=0 '\0' ...} | NLMISC::CRGBA
▶ | _Specular | {R=0 '\0' G=0 '\0' B=0 '\0' ...} | NLMISC::CRGBA
  | _Shininess | 10.0000000 | float
  | _AlphaTestThreshold | 0.00392156886 | float
  | _Touched | 0 | unsigned int
  | _StainedGlassWindow | false | bool
  | _TexCoordGenMode | 0 | unsigned short
▶ | _TexUserMat | empty | std::unique_ptr<NL3D::CMaterial::CUserTexMat,std::default_delete<NL3D::CMaterial::CUserTexMat>>
▶ | _Textures | 0x0000025c38759ba8 {{Ptr=0x0000025c74016c50 {_FileName="r2_pionneer_edit.tga" _AllowDegradation=true ...} }, ...} | NLMISC::CSmartPtr<NL3D::ITexture>[4]
▶ | _TexAddrMode | 0x0000025c38759bc8 "ÍÍÍÍ... | unsigned char[4]
▶ | _TexEnvs | 0x0000025c38759bcc {{EnvPacked=2560692737 Env={OpRGB=1 SrcArg0RGB=0 OpArg0RGB=0 ...} ConstantColor={...} }, ...} | NL3D::CMaterial::CTexEnv[4]
▶ | _MatDrvInfo | {pinfo=0x0000025c7694dec0 {Ptr=0x0000025c720ecb18 {crefs=0 pinfo=0x0000025c7694dec0 {Ptr=0x0000025c720ecb18 {...} ...} } ...} ...} | NLMISC::CRefPtr<NL3D::IMaterialDrvInfos>
▶ | _LightMaps | { size=0 } | std::vector<NL3D::CMaterial::CLightMap,std::allocator<NL3D::CMaterial::CLightMap>>
  | _LightMapsMulx2 | false | bool
kervala commented 4 years ago

I have no idea, I had no opportunity to check the Ring since it was removed :s

Do you remember when it still worked ?

kaetemi commented 4 years ago

Not sure, but I remember you fixed the issue with the trees that occurred on OpenGL. Any chance it's related?

kaetemi commented 4 years ago

I'm restoring all classic functionality (Ring, etc.) on ryzomclassic-develop branch.

kaetemi commented 4 years ago

It last worked maybe 10 years ago, or something..

nimetu commented 4 years ago

Maybe 5e3cd0321 is related? Editor decal are created before scene is created.

kaetemi commented 1 year ago

image

Still occurring, only a faint outline visible.

kaetemi commented 1 year ago

https://cdn.ryzom.dev/core/NeL_WRK_IT2.zip

Decal optimization branch from NeL that was never merged in, based on some old NeL CVS version.