05:56 adavy: q4a: have you checked the color encoding ,
05:57 adavy: just to be sure you write green, red, and check it at the right place
06:00 adavy: I do not see any obvious mistake in the code
06:00 adavy: what are the colors ?
07:40 q4a: adavy: I push commits when got all `succ`, so colors are in `tests` array:
07:40 q4a: https://github.com/q4a/sdl_triangle/blob/4136c8fbbb6096bacfc0d07822d5855c297edca3/d3d9_square/src/d3d9_square.cpp#L172 - this version has all green colors except tests[4] and tests[5] where color is 0x00aa5500
07:42 q4a: Yesterday it was late and I forgot that z and w changing in a cycle. It seems that as long as w is less than 1, then I see only the color of the fog:
07:42 q4a: https://github.com/q4a/sdl_triangle/blob/f3eedf2b3a02d531c29bdc0e7f2ae92a5bcff8f4/d3d9_square/src/d3d9_square.cpp#L172
07:46 q4a: I changed w in tests: now it is between 0.9f and 3.0f + I comment out z changing. Result: when w==0.9f - i got green (0x0000ff00) color, w==3.0f - I got same color as in previous test (0x00aa5500) while z the change is commented out.
07:46 q4a: w==1.1f - color 0x0017e800. w==2.6f - color 0x009d6200
07:48 q4a: I'll be a bit busy today, but will read and check your messages later(evening) today.
17:08 adavy: q4a: XYZRHW -> the w you pass 1/W
17:08 adavy: thus 1/0.9 > 1 your fog end
17:08 adavy: RHW means 1/w
17:10 adavy: I think it is interesting to test the interpolation aspect, so have different w at the corners, not replace all of them by the same value
17:43 adavy: what would be then interesting to change is not the w and z at the corners, but the combination of ps/vs (xyz, xyzrhw, ff, programmable, vs/ps)
17:44 adavy: and the projection matrix (projection matrix with 0010 for the last row, projection matrix with a multiple of that, identity matrix)
17:45 adavy: if you multiply the whole projection matrix by a constant, it's not supposed to change the position of the points, but it will change the value of w, and thus fog
17:45 adavy: but only if the projection matrix is actually used (ff vs)
17:45 adavy: for the other combinations it shouldn't impact
17:55 q4a: Ok, I'll try to add more variants to this test.
18:43 q4a: adavy: https://github.com/q4a/sdl_triangle/blob/67c483ac8572e2278ff9c6a8093453e04380fff7/d3d9_square/src/d3d9_square.cpp#L172 - updated tests with different w at the corners and 3 matrices
18:44 q4a: So when I multiplied the whole projection matrix by 2 - I got same colors. Is that ok or my projection matrix is bad?
18:54 adavy: q4a: I think it should only affect colors if we use vs ff
18:55 adavy: xyzrhw bypasses the ff
18:55 adavy: it is part of the test to test that it does change only in the vs ff case and not the others
19:02 q4a: ok, should I remove some tests (like w== 2.6f or 3.0f - they basically the same ) and add test with D3DFVF_XYZ instead of D3DFVF_XYZRHW?
19:02 adavy: yes exactly
19:03 adavy: You do not need the tests with depth test enabled
19:03 adavy: you do not need either to test many w/z
19:12 adavy: Adding a W to D3DFVF_XYZ data will need to use clever world matrices I guess
19:13 adavy: maybe having W = z + constant (last row of the world matrice being 0 0 1 constant)
19:28 adavy: when using programmable vs it will be simple as w can be passed as texcoord