Back in commit cd79de1 it looks like set_shader_input() was changed to no longer accept strings. I’m trying to track down a bug that I think might be shader related and wanted to just clarify that this is doing what I think it is.
I had a line in the 1.8 code that was
this->terrainParentNP.set_shader_input( "cameraAltitude", camPositionLLA.GetAlt() ); //alt is a double
and changed in the 1.10 code to
this->terrainParentNP.set_shader_input( "cameraAltitude", camPositionLLA.GetAlt(), 0); //alt is a double
INLINE void set_shader_input(CPT_InternalName id, int n1, int n2, int n3=0,
int n4=0, int priority=0); //where n1 = altitude and n2 = 0
Could anyone clarify this for me? I’m having issues with my terrain and water showing up oddly or not at all and would like to cross this off the possible causes.
[Edit 1] When I zoom out really far the 1.10 flickers a bunch as I zoom (z-fighting possibly?) and then settles here:
1.8
1.10
[Edit 2]
If anyone runs into this issue later I’ve made some progress that might help you. I’ve flipped the sort order of my 10 texture stages and made some headway.
However, once I start to zoom out (in this case just moving the camera away from the hill), the terrain disappears and then bottom of the world shows through.
@rdb Is there anything that you know of from 1.8->1.10 that would change the frame buffer capabilities? I just noticed that color bits went from 32->24. I can’t find a function in my build of 1.8 that will let me query rgb separately so I can’t see if those match.
The following is an ouput from FrameBufferProperties::Output
Edit:
The config.prc files are exactly the same and have this in them:
# These set the minimum requirements for the framebuffer.
# A value of 1 means: get as many bits as possible,
# consistent with the other framebuffer requirements.
depth-bits 1
color-bits 1
alpha-bits 0
stencil-bits 1
framebuffer-multisample 0
multisamples 0
It might be helpful to use a tool like apitrace to generate a trace of the OpenGL calls, and then use qapitrace to inspect the OpenGL state and shaders to see if something odd is going on.
color-bits should not be 32; it only includes the red, green, blue channels, so 24 sounds right.
As for requesting framebuffer properties, the new recommendation in 1.10 is to use set_rgba_bits(8, 8, 8, 8) instead of something like set_color_bits(24).