Page MenuHomeWildfire Games

Adds Camera test for correct frustum
ClosedPublic

Authored by vladislavbelov on Mon, May 27, 8:40 PM.

Details

Reviewers
wraitii
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Commits
rP22319: Adds Camera test for frustum.
Summary

Adds additional check before adding isometric projections.

Test Plan
  1. Apply the patch and compile tests
  2. Run tests
  3. Make sure that the added test passed

Diff Detail

Repository
rP 0 A.D. Public Repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

vladislavbelov created this revision.Mon, May 27, 8:40 PM
Stan added a subscriber: Stan.Mon, May 27, 8:45 PM
Stan added inline comments.
source/graphics/tests/test_Camera.h
35 ↗(On Diff #8172)

Might want to try with a non-square and non power of 2 resolution.

60 ↗(On Diff #8172)

Order of planes is unknown maybe.

Build failure - The Moirai have given mortals hearts that can endure.

Linter detected issues:

Link to build: https://jenkins.wildfiregames.com/job/differential/1521/display/redirect

vladislavbelov added inline comments.Mon, May 27, 8:54 PM
source/graphics/tests/test_Camera.h
35 ↗(On Diff #8172)

Yep, but it won't have so nice normals. Probably in next tests.

60 ↗(On Diff #8172)

Sounds ok.

Stan added inline comments.Mon, May 27, 8:55 PM
source/graphics/tests/test_Camera.h
35 ↗(On Diff #8172)

More likely to break then :P

89 ↗(On Diff #8172)

I didn't know this existed. nice. Is it slower than a standard check ? Doesn't matter here anyway.

vladislavbelov added inline comments.Mon, May 27, 8:58 PM
source/graphics/tests/test_Camera.h
35 ↗(On Diff #8172)

The patch is more about a valid frustum. I'll add few tests in next patches.

89 ↗(On Diff #8172)

What do mean by standard? std::abs?

Stan added a comment.EditedMon, May 27, 9:11 PM

Test pass in release and debug mode for me.

Got this in the debug output but it's unrelated to your patch

inkernel\crts\ucrt\inc\corecrt_internal_string_templates.h(67) : Assertion failed: ((destination)) != NULL && ((size_in_elements)) > 0
minkernel\crts\ucrt\inc\corecrt_internal_string_templates.h(67) : Assertion failed: ((destination)) != NULL && ((size_in_elements)) > 0
minkernel\crts\ucrt\inc\corecrt_internal_string_templates.h(67) : Assertion failed: ((destination)) != NULL && ((size_in_elements)) > 0
minkernel\crts\ucrt\inc\corecrt_internal_string_templates.h(68) : Assertion failed: (((source))) != NULL
minkernel\crts\ucrt\inc\corecrt_internal_string_templates.h(67) : Assertion failed: ((destination)) != NULL && ((size_in_elements)) > 0
minkernel\crts\ucrt\inc\corecrt_internal_string_templates.h(81) : Assertion failed: (L"Buffer is too small" && 0)
minkernel\crts\ucrt\inc\corecrt_internal_string_templates.h(81) : Assertion failed: (L"Buffer is too small" && 0)
minkernel\crts\ucrt\inc\corecrt_internal_string_templates.h(81) : Assertion failed: (L"Buffer is too small" && 0)
minkernel\crts\ucrt\inc\corecrt_internal_string_templates.h(218) : Assertion failed: (L"Buffer is too small" && 0)
minkernel\crts\ucrt\inc\corecrt_internal_string_templates.h(218) : Assertion failed: (L"Buffer is too small" && 0)
minkernel\crts\ucrt\inc\corecrt_internal_string_templates.h(218) : Assertion failed: (L"Buffer is too small" && 0)
minkernel\crts\ucrt\inc\corecrt_internal_string_templates.h(25) : Assertion failed: ((destination)) != NULL && ((size_in_elements)) > 0
minkernel\crts\ucrt\inc\corecrt_internal_string_templates.h(25) : Assertion failed: ((destination)) != NULL && ((size_in_elements)) > 0
minkernel\crts\ucrt\inc\corecrt_internal_string_templates.h(25) : Assertion failed: ((destination)) != NULL && ((size_in_elements)) > 0
minkernel\crts\ucrt\inc\corecrt_internal_string_templates.h(26) : Assertion failed: (((source))) != NULL
minkernel\crts\ucrt\inc\corecrt_internal_string_templates.h(25) : Assertion failed: ((destination)) != NULL && ((size_in_elements)) > 0
minkernel\crts\ucrt\inc\corecrt_internal_string_templates.h(39) : Assertion failed: (L"String is not null terminated" && 0)
minkernel\crts\ucrt\inc\corecrt_internal_string_templates.h(50) : Assertion failed: (L"Buffer is too small" && 0)
minkernel\crts\ucrt\inc\corecrt_internal_string_templates.h(50) : Assertion failed: (L"Buffer is too small" && 0)
minkernel\crts\ucrt\inc\corecrt_internal_string_templates.h(50) : Assertion failed: (L"Buffer is too small" && 0)
minkernel\crts\ucrt\inc\corecrt_internal_string_templates.h(50) : Assertion failed: (L"Buffer is too small" && 0)
minkernel\crts\ucrt\inc\corecrt_internal_string_templates.h(50) : Assertion failed: (L"Buffer is too small" && 0)
minkernel\crts\ucrt\inc\corecrt_internal_string_templates.h(155) : Assertion failed: (L"Buffer is too small" && 0)
minkernel\crts\ucrt\inc\corecrt_internal_string_templates.h(155) : Assertion failed: (L"Buffer is too small" && 0)
minkernel\crts\ucrt\inc\corecrt_internal_string_templates.h(155) : Assertion failed: (L"Buffer is too small" && 0)
minkernel\crts\ucrt\inc\corecrt_internal_string_templates.h(155) : Assertion failed: (L"Buffer is too small" && 0)
minkernel\crts\ucrt\inc\corecrt_internal_string_templates.h(155) : Assertion failed: (L"Buffer is too small" && 0)
minkernel\crts\ucrt\src\appcrt\stdio\output.cpp(277) : Assertion failed: ("Buffer too small", 0)
minkernel\crts\ucrt\src\appcrt\stdio\output.cpp(277) : Assertion failed: ("Buffer too small", 0)
minkernel\crts\ucrt\src\appcrt\stdio\output.cpp(266) : Assertion failed: buffer != nullptr && buffer_count > 0
minkernel\crts\ucrt\src\appcrt\stdio\output.cpp(266) : Assertion failed: buffer != nullptr && buffer_count > 0
minkernel\crts\ucrt\src\appcrt\stdio\output.cpp(265) : Assertion failed: format != nullptr
minkernel\crts\ucrt\src\appcrt\stdio\output.cpp(277) : Assertion failed: ("Buffer too small", 0)
minkernel\crts\ucrt\src\appcrt\stdio\output.cpp(277) : Assertion failed: ("Buffer too small", 0)
minkernel\crts\ucrt\src\appcrt\stdio\output.cpp(266) : Assertion failed: buffer != nullptr && buffer_count > 0
minkernel\crts\ucrt\src\appcrt\stdio\output.cpp(266) : Assertion failed: buffer != nullptr && buffer_count > 0
minkernel\crts\ucrt\src\appcrt\stdio\output.cpp(265) : Assertion failed: format != nullptr
'test_dbg.exe' (Win32): Loaded 'D:\Dev\0ad-svn\ps\trunk\binaries\system\libsodiumd.dll'. Cannot find or open the PDB file.
Exception thrown at 0x7769C762 in test_dbg.exe: Microsoft C++ exception: PSERROR_Serialize_ScriptError at memory location 0x0057E5A0.
Exception thrown at 0x7769C762 in test_dbg.exe: Microsoft C++ exception: PSERROR_Serialize_OutOfBounds at memory location 0x0057F9FC.
Exception thrown at 0x7769C762 in test_dbg.exe: Microsoft C++ exception: PSERROR_Serialize_OutOfBounds at memory location 0x0057F9FC.
Exception thrown at 0x7769C762 in test_dbg.exe: Microsoft C++ exception: PSERROR_Serialize_InvalidScriptValue at memory location 0x0057E200.
Detected memory leaks!
Dumping objects ->
{1888676} normal block at 0x07E367A8, 192 bytes long.
 Data: </               > 2F 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
{1888669} normal block at 0x07E35C68, 192 bytes long.
 Data: </               > 2F 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
Object dump complete.
The program '[17052] test_dbg.exe' has exited with code 0 (0x0).
source/graphics/tests/test_Camera.h
89 ↗(On Diff #8172)

Nah the => <= way :)

In D1927#79601, @Stan wrote:

Test pass in release and debug mode for me.

Thank you!

Got this in the debug output but it's unrelated to your patch

Probably we need to fix them somewhen too :)

source/graphics/tests/test_Camera.h
89 ↗(On Diff #8172)

Ah, we don't compare by less/greater, we check equality. But we can't just compare float point numbers, we have to use epsilon.

So |x - expected| < EPS means that the x is lying inside an epsilon neighbourhood of expected.

Stan added a comment.Mon, May 27, 9:31 PM

yeah I meant a - b > epsilon || - a + b >= epsilon

In D1927#79606, @Stan wrote:

yeah I meant a - b > epsilon || - a + b >= epsilon

I think it really depends on a compiler. Theoretically std::fabs can be faster because of less number of arithmetic operations and less number of comparisons.

wraitii accepted this revision.Tue, May 28, 9:35 AM
This revision is now accepted and ready to land.Tue, May 28, 9:35 AM
This revision was landed with ongoing or failed builds.Wed, May 29, 10:12 PM
This revision was automatically updated to reflect the committed changes.