Anonymous Login
2020-09-25 02:20 UTC

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0000575OpenClonkGraphicspublic2017-08-20 11:39
ReporterEroSennin 
Assigned To 
PrioritylowSeveritytrivialReproducibilityalways
StatusacknowledgedResolutionopen 
PlatformGNU G++OSLinuxOS Version 
Product Version 
Target Version8.1Fixed in Version 
Summary0000575: Moon vanishes if zoomed in too far
DescriptionWhen your clonk walks down the first hill the moon isn't there. Walking further the moon suddenly appears.
(It can also vanish and reappear.)
Steps To ReproduceStart the Lesson Close Range Weapon (Nahkampfwaffen)
TagsNo tags attached.
Attached Files

-Relationships
has duplicate 0000664closed Tutorial 4: And suddenly: moon! 
+Relationships

-Notes

~0001571

Ringwaul (developer)

It seems to disappear when the camera is zoomed in 'too far'. When the camera is pulled back, the moon reappears.

Of course I have no idea why...

~0001572

Günther (developer)

I suspect the clipping interacts badly with the parallaxity.

~0001951

Ringwaul (developer)

Changed the title of the bug-report since this bug occurs for all scenarios

~0002271

Newton (administrator)

Sven suspected that the virtual camera calculated for parallax objects might get "behind" the moon if zoomed in too far.

Anyway, it would be great if you had a look at this, Günther. From all the people in the project, I think you are the one that understands the parallax drawing the most.

You could start a scenario with just a clonk and the moon, put a breakpoint in the drawing routine of the moon or something. So, are you up to it? (Just assign back to me if you don't think you can fix that anytime soon - I will give it a try then.)

~0002292

Günther (developer)

I suspect the right thing would be to simply remove the out-of-bounds check and let the drawing code handle it. Perhaps only for parallax objects if that turns out to be too slow.

~0002293

Newton (administrator)

Wouldn't then all objects in the landscape tried to be drawn? (instead of just those that are within the viewport.

~0002294

Günther (developer)

yes.

~0002295

Newton (administrator)

I think the better way would be to fix the clipping code for parallax objects.

~0002306

Günther (developer)

Removing the "// Output boundary" block in C4Object::Draw seems to fix this.

~0002311

Günther (developer)

Does this suffice?
diff --git a/src/object/C4Object.cpp b/src/object/C4Object.cpp
index aa1dfb6..8dbd8d7 100644
--- a/src/object/C4Object.cpp
+++ b/src/object/C4Object.cpp
@@ -1892,7 +1892,7 @@ void C4Object::Draw(C4TargetFacet &cgo, int32_t iByPlayer, DrawMode eDrawMode, f
        if (!eDrawMode) SetAudibilityAt(cgo, GetX(), GetY());
 
        // Output boundary
- if (!fYStretchObject && !eDrawMode)
+ if (!fYStretchObject && !eDrawMode && !(Category & C4D_Parallax))
        {
                if (pActionDef && !r && !pActionDef->GetPropertyInt(P_FacetBase) && Con<=FullCon)
                {

~0002312

Newton (administrator)

so real clipping is not possible then?

~0002314

Günther (developer)

I don't feel like doing the necessary math. This is me finally admitting this and removing bug reminding me that I haven't done it "yet".

Though it might be as simple as applying the new zoom to the offX/offY coordinates in that block.

~0002315

Günther (developer)

well, and the dimensions.

~0002317

Newton (administrator)

Last edited: 2012-10-31 17:22

View 2 revisions

If its that easy (for you) I don't understand why you chose to do that solution - that is something I could have done as well.

Don't you have a PC where you can test the changes?

~0002322

Günther (developer)

The keyword is _might_. And it might be *newzoom/oldzoom, or (offx-viewportx)*newzoom/oldzoom + viewportx, or something else. And the biggest task is to test the edge cases, for example objects with unusual offsets.
+Notes

-Issue History
Date Modified Username Field Change
2011-02-04 14:33 EroSennin New Issue
2011-02-04 15:38 Maikel Status new => confirmed
2011-02-05 19:40 Ringwaul Note Added: 0001571
2011-02-05 21:37 Günther Note Added: 0001572
2011-10-01 08:46 Maikel Relationship added has duplicate 0000664
2011-10-18 17:30 Ringwaul Note Added: 0001951
2011-10-18 17:30 Ringwaul Summary Moon appears suddenly in Close Range Weapons Lesson => Moon appears suddenly
2012-10-21 22:21 Newton Status confirmed => new
2012-10-21 22:21 Newton Summary Moon appears suddenly => Moon vanishes if zoomed in too far
2012-10-21 22:23 Newton Note Added: 0002271
2012-10-21 22:23 Newton Assigned To => Günther
2012-10-21 22:23 Newton Status new => assigned
2012-10-27 17:35 Günther Note Added: 0002292
2012-10-27 17:38 Newton Note Added: 0002293
2012-10-27 17:39 Günther Note Added: 0002294
2012-10-27 17:56 Newton Note Added: 0002295
2012-10-28 01:43 Günther Note Added: 0002306
2012-10-30 16:50 Günther Note Added: 0002311
2012-10-30 18:23 Newton Note Added: 0002312
2012-10-30 21:18 Günther Note Added: 0002314
2012-10-30 21:21 Günther Note Added: 0002315
2012-10-31 17:20 Newton Note Added: 0002317
2012-10-31 17:22 Newton Note Edited: 0002317 View Revisions
2012-10-31 18:04 Günther Note Added: 0002322
2013-12-07 06:49 Newton Assigned To Günther =>
2013-12-07 06:49 Newton Status assigned => acknowledged
2015-10-16 00:33 Sven2 Target Version => 7.0
2016-01-02 19:45 Clonkonaut Target Version 7.0 => 8.0
2017-08-20 11:39 Zapper Target Version 8.0 => 8.1
+Issue History