Wrong shader colors i think is the right words.
Code: Select all
" vec4 txcol = texelFetch( s_color, ivec2( ( int(txindex.g*65280.0) | int(txindex.r*255.0)) ,0 ) , 0 );\n"Code: Select all
" vec4 txcol = texelFetch( s_color, ivec2( ( int(txindex.g*65280.0) | int(txindex.r*255.0)) ,0 ) , 0 );\n"Code: Select all
255.0Do you mean you changed 255.0 to 255.1? What is the range of values in txindex.g, AFAIK it needs to be less than 0.25 (or less depending on the width of the texture, 4096 is the reported maximum). I don't know what happens of you try reading over that.Notthesameman wrote: ↑Thu Apr 09, 2020 2:36 pmupdate: if i changethe 0 to 1 i get more proper colors, the colors are reversed on the whole screen, backgrounds are still the same.Code: Select all
255.0
Code: Select all
txindex.g*0.25Code: Select all
txindex.g*0.20Code: Select all
txindex.g*165280.0Code: Select all
txindex.r*255.0how do i know when txindex is 16bit or other bits? not sure if what im trying to do is 1D texture?Paeryn wrote: ↑Thu Apr 09, 2020 7:10 pmI was wondering because you look to be using the green and red channels of txindex as a 16-bit index into a 1D texture. The 0.25 limit on the green channel I suggested is because if it is 0.25 or higher then you are going to end up with a value that is larger than the maximum texture width that OpenGL says is supported (4096 on a Pi4, I've an idea Pi0-3 is only 2048 but I haven't got one set up to test). What is the width of the texture bound to s_color anyway?
Scaling the green component down isn't likely to help as that will mess up all the indices, you need to make sure that the values are in range. This might not be the actual problem, it's just the most likely that I can think of since in your other thread you said it worked on other hardware.
Code: Select all
if (param->sprite != -1){
glUniform1i(param->sprite, 0);Code: Select all
" vec4 txcol = texelFetch( s_color, ivec2( ( int(txindex.g*255.116)<<8 | int(txindex.r*255.120)) ,0 ) , 0 );\n"