Closed JohnCC330 closed 4 years ago
Weird problem. I see nothing obvious in what you posted, but have some questions & thoughts.
Is there a reason you are specifying a prefix and libdir on the configure? Not that I really think this the issue, but I also think you should be able to let them default.
I think using slackware64-current puts you on the bleeding edge for that distribution. Do older stable versions have this issue? Does this version of Slackware ship with an updated SDL1.2?
After a successful make, instead of installing are you able to do the test render with 'make check'? If so, does it also change the screen's colors?
If you render with -d (no SDL 1.2 display) do things work OK? If so, I'd start to suspect your version of SDL1.2. If your screen still gets mangled, could you try a configure with the additional argument: CXXFLAGS="-fstack-protector-strong" and another compile 'make -j2' and then 'make check'.
Your configure output (FYI it and other perhaps would be more readable as attached text files) has a bunch of incompatible messages from the gnu linker (ld). This is not normal, but given you do link guess something compatible is later found...
If you've not tried it, a fresh compile of 3.7-stable off github through a 'make check' render might be interesting. It was not clear to me whether you had similarly recompiled 3.7 or just run what you had installed?
There are also a couple of branches about with support for SDL2.0 mostly done by @LeForgeron and he has a version of this as part of his hgpovray38 version.
https://github.com/LeForgeron/povray/tree/hgpovray38
or my nearly identical version. (I did some x11 edits ahead of his doing them in his version, but probably they are the same effectively)
https://github.com/wfpokorny/povray/tree/update/JG_sdl2
If one of these v38 based versions work OK, this too would suggest something with SDL1.2 and the version of slackware you are running. If not, ...
I tried your test scene on my Ubuntu 18.04, g++ 7.4 machine and all OK. Something to note is you had no version statement at the top of your scene and if memory serves this will default to version 3.6 but v37 didn't get this quite right while v38 does - there is a color shift. If you want to avoid this color shift add #version 3.7; at the very top of your scene (or #version 3.6;).
The last thought at the moment is the current v38 master is set up for C++11, I'm not sure what your g++ 8.3 defaults to. My g++ 7.4 is using C++14 by default I think. No idea why this would matter, but could try a compile setting the standard to C++11.
On Fri, 06 Sep 2019 16:27:07 -0700 wfpokorny notifications@github.com wrote:
Weird problem. I see nothing obvious in what you posted, but have some questions & thoughts.
- Is there a reason you are specifying a prefix and libdir on the configure? Not that I really think this the issue, but I also think you should be able to let them default.
Slackware 64-bit uses a rather un-standard /usr/lib64 path for the libraries. /usr/lib is the default for 32-bit libraries. They shouldn't mix.
- I think using slackware64-current puts you on the bleeding edge for that distribution. Do older stable versions have this issue? Does this version of Slackware ship with an updated SDL1.2?
Yes. The only reason I changed to the newer version of POVray is that I had a strange conflict with the libpng15 library. So I removed libpng15 entirely and recompiled with png16.
SDL is also 1.2.
- After a successful make, instead of installing are you able to do the test render with 'make check'? If so, does it also change the screen's colors?
Just checked... Yes, colors are modified.
- If you render with -d (no SDL 1.2 display) do things work OK? If so, I'd start to suspect your version of SDL1.2. If your screen still gets mangled, could you try a configure with the additional argument: CXXFLAGS="-fstack-protector-strong" and another compile 'make -j2' and then 'make check'.
-D (which I suspect you meant) finishes the render completely and generates the .PNG correctly.
- Your configure output (FYI it and other perhaps would be more readable as attached text files) has a bunch of incompatible messages from the gnu linker (ld). This is not normal, but given you do link guess something compatible is later found...
Yes. I'm suspecting /usr/lib is hardcoded somewhere, or the link search path get's modified. It should never look in /usr/lib (or /usr/local/lib)
I'll try to do the rest of the suggestions later.
Thanks for the reply - will report with the rest.
John
Sorry for the delay, I've had to correct partials at the uni. I found some time to test the other versions:
There are also a couple of branches about with support for SDL2.0 mostly done by @LeForgeron and he has a version of this as part of his hgpovray38 version.
This version does not compile:
...
usr/include/boost/math/common_factor.hpp:16:60: note: #pragma message: This header is deprecated. Use <boost/integer/common_factor.hpp> instead.
BOOST_HEADER_DEPRECATED("<boost/integer/common_factor.hpp>");
^
backend/scene/view.cpp: In member function ‘void pov::ViewData::getBlockXY(unsigned int, unsigned int&, unsigned int&)’:
backend/scene/view.cpp:244:53: error: expected primary-expression before ‘long’
unsigned long perimeter = std::abs<long>(south-north)*2+std::abs<long>(east-west)*2;
^~~~
backend/scene/view.cpp:252:43: error: expected primary-expression before ‘long’
perimeter = std::abs<long>(south-north)*2+std::abs<long>(east-west)*2;
or my nearly identical version. (I did some x11 edits ahead of his doing them in his version, but probably they are the same effectively)
This version does compile, but produces the same problem as before (i.e. the colors get mixed up)
If you've not tried it, a fresh compile of 3.7-stable off github through a 'make check' render might be interesting. It was not clear to me whether you had similarly recompiled 3.7 or just run what you had installed?
Yes, I re-downloaded the -stable version and re-compiled. Several times in fact.
I'll try to find the original (old) 3.7.0 which used to work, and retry that version.
Some more thinking aloud given what I think I've heard you say:
With a #version 3.7 statement added, compiles of v37-stable, v37v38-master and my v38 JG_sdl2 all cause all your root window dependent window colors to shift. True unless you use -D(-d) in which case everything is OK? In other words, we now know it has something to do with the preview window no matter the version of POV-Ray and with both mainline versions of SDL.
povray --preview x11 +d +p Johns.pov
I'm puzzled povray can mangle the root and root based x11 windows... And the mangling to me looks like some sort of value clamping gone wrong.
When does the color distortion happen? If we add the AA flags: +am1 +a0.0 +r6 to slow the render of your test scene. Is the color mangling there more or less immediately - or does it take time (take reaching a value it might clamp is what I'm thinking)?
Another quick experiment would be doing a problem render with +wt1 so only one thread gets used. (is it somehow a thread safety issue?)
I understand you've not compiled with stronger stack protections, forced the c++ version to 11 or done new compiles with slightly more stable / older versions of slackware? Currently, the latter two of more interest.
@LeForgeron (JG) posted an issue related to having (or not having) the DISPLAY variable set. I was occupied when he posted it, suppose I'll go give it a read now. Maybe some clue there.
I don't know what else to do here except keep experimenting. Suppose you've checked the usual slackware support forums for similar, recent issues?
Edit: Sep 17 06:00:16 EDT 2019 Fixed typo with a version number at top. See strike-through.
OK. @LeForgeron 's DISPLAY issues are #156 and #157 and related to DISPLAY not being set at all or set to a window which does not exist. The failure symptoms are different and in your case I have to believe your DISPLAY is set correctly given what you see.
you can fix/change view.cpp with the following
I do not know why you do not have std::abs
This part of view.cpp is only to handle the rendering pattern as a spiral.
From my investigation on x11/SDL/SDL2 : povray (master) will try to use SDL if available, otherwise it goes to X11. And the X11 code is a nightmare (because the X library have constraint on the thread which performs the operation).
On hgpovray38, the order of choices is SDL2, then SDL, and whatever X11 can be selected manually. (SDL2 and SDL are not usable by a single binary, you cannot ask for both).
I tried many variations on X11, including using mutex & other tricks, to finally give up (IIRC, the master version of disp_x11 is stupid, there is plenty of optimisation to transfer only the update block, but it ends transfering the whole pixmap each time because the optimisation was hard-coded in the time of rendering one pixel at a time of 3.1, and this is plain wrong today)
A basic program is fine, and sometime a render is fine too, but I also got corrupted preview.
About the change of colours for whole screen, the disp_x11 tried to handle many screen mode (including static_display, and palettes): in the current world of true colors everywhere, it is overly complicated. If your display only support a global palette, it is kind of expected that this palette get updated for the render windows.
@JohnCC330, @LeForgeron 's comments about the x11 display reminded me there was some command I used long ago to dump x11 settings. Web search tells me that command is xdpyinfo. Might be interesting to see what you see running xdpyinfo. I see 24 planes (DirectColor) or 32 planes (TrueColor) everywhere.
@wfpokorny xdpyinfo reports a large numer of configurations available (270!), also 24 plane DirectColor and 32 plane Truecolor. Maybe some of these configurations are problematic?
With all the mentions of SDL and SDL2, I searched for simple demo programs for both. Behold - both test programs cause the color issues. For SDL I compiled & ran sdltest. For SDL2 I ran the Hello World example
The latter needs some coaxing to get it to build. Si I suspect that the issue is between SDL and the video, and not Povray? I'll try to find out more...
Running small SDL1.2, SDL2 demos a good idea and yes SDL* certainly a trigger - and a simpler debug path for whatever is happening. Using my JG_SDL2 branch (or a patched hgpovray38), you can try POV-Ray with x11 thanks to @LeForgeron: povray --preview x11 +d +p the.pov
Suppose I'd say if it works without the color shift, it makes stronger the case it is just SDL triggering. If still a color shift, well, the demos of SDL probably still a better debug path. The SDL folks will be much better debuggers (certainly than me) for this sort of thing as it's more central to what they do.
I looked over your xdpy.txt and compared it to mine. Your running a newer version. I have three extensions you don't. You are runnming many more x11 things than me - 270 vs 70. One thing different is the name of your display is :6.0 where mine is :0 ($DISPLAY). The position after the colon is the display number and I am surprised it's not 0 for you like me unless your machine is seeing multiple logins or something. Used to be I knew the X11 stuff a little better, but the knowledge has drifted away with the years.
Solved! Even though all other programs worked fine (except for the SDL* demos) my system (with the AMDGPU) apparently needs two kernel modules (amdgpu and radeon) to work and support AMD's GPUs. For some reason, the radeon kernel module was blacklisted and thus did not load. I couldn't believe that none of the other programs complained or failed.
Thanks for all suggestions! All archived for future adventures ;)
Summary
When running 3.8.0, with command povray image.pov, colors of entire screen are affected (not only in the povray window). This maybe a driver issue: Making a screenshot saves the correct colors. This did not occur in 3.7
Environment
release
No errors
config_log.gz
include "colors"
light_source { <4, 2, 3>, White }
camera { location <0, 0, 0> look_at <5, 0, 0> }
sphere { <5, 1.5, 0>, 1 finish { reflection 0.4 } pigment { color Red } }
plane { x, 9 pigment { color Gray10 } }
cone { <0, -1, 0>, 1, <0, 1, 0>, 0.5 pigment { color Green } scale 0.3 translate <4, 1, 1> }
box { <1, 1, 1>, <-1, -1, -1> pigment { color Yellow } finish { reflection 1 } rotate <30, 120, 0> translate <5, 0, 0> }