Posts: 44
Joined: Mar 2008
Reputation:
0
slight
Junior Member
Posts: 44
A lot of projectors have some sort of issue with alignment of the red green and blue pixel components, especially as they age. It occurs to me that this could be compensated for in software by adjusting the alignment of the R,G and B channels in the data sent to the projector.
For example, with my AX200 the red channel is currently displaying about one pixel to the left, and the blue channel is displaying about one pixel to the right. If the red channel in the data sent to the projector was shifted one pixel right, and the blue one pixel left then I'd have a properly aligned image.
Now obviously the fact that my alignment pretty much matches the pixel boundaries would make it easier to fix in my case, but it seems likely to me that with sub-pixel interpolation you could apply the same principle for sub-pixel offsets.
I'm guessing this could probably be done *relatively* easily in a pixel shader?
Any thoughts?
Posts: 26,215
Joined: Oct 2003
Reputation:
187
Relatively easily I suspect yes. Feel free to give it a crack. I'm not sure whether or not such a patch would be useful or not to the majority of users, but if it's clean then it will certainly be considered for inclusion.
Posts: 44
Joined: Mar 2008
Reputation:
0
slight
Junior Member
Posts: 44
2009-01-11, 19:32
(This post was last modified: 2009-01-11, 19:43 by slight.)
I wouldn't really know where to start unfortunately. I've been programming for years but web applications nothing like this.
Am I right in thinking I'd need to write it in GLSL? I could look into that, but I'm afraid working out how to integrate it into XBMC is probably beyond me...
Posts: 889
Joined: Jan 2008
Reputation:
11
Wow great idea, how has nobody thought of this before?! This would really be great for projector owners, as color shift has typically been a "live with it" problem from what I've read. My projector has a pretty significant color shift as well (common problem I guess) and it'd really be exceptional to be able to fix it in software.
Like you, slight, I wouldn't have the first clue where to start unfortunately. Could somebody maybe give us some guidance please? Subjects to read up on, where in the XBMC code to poke around, etc? I understand that perhaps not enough users use projectors to warrant a dev looking into the feature but I'd be thankful if somebody could help point me in the right places so I could see if I can hack it in on my own :0)
Posts: 889
Joined: Jan 2008
Reputation:
11
OK I taught myself some OpenGL and poked around enough in the XBMC code that I've got this working for GLSL (Advanced) shaders while playing movies. It allows you to shift R, G, and/or B on both x and y axis by using advancedsettings.xml. I have no clue how to implement it in ARB and I'm not going to bother learning so I think it'll just be a GLSL-only thing :0)
I also have no idea how to implement it into the rest of XBMC (other than just video playback). The video playback part already had shaders implemented so I was able to just add onto them, but it looks like I'm going to have to read & understand an awful lot more of the XBMC code before I'll be able to figure out where to add a shader to the core XBMC renderer.
Unless/until I figure the rest out and get a patch accepted into the trunk (which I guess would be after 9.04 even if I figured the rest out tomorrow) you'll have to just PM me if you want a build with this feature.
Posts: 889
Joined: Jan 2008
Reputation:
11
I tried making a patch the night I coded it and TortoiseSVN complained about line endings and refused to do anything... I'll try to figure out what its problem is and generate a patch tonight. I'll post here and on trac when I do.
Posts: 44
Joined: Mar 2008
Reputation:
0
slight
Junior Member
Posts: 44
Any idea if this will work with the nVidia VDPAU acceleration by the way?
Posts: 44
Joined: Mar 2008
Reputation:
0
slight
Junior Member
Posts: 44
That's a shame, though I can live with it personally as I'm only using 720p content so don't need VDPAU.
Would it be possible to implement something like this for VDPAU though? I have no concept of how the pipeline for processing works so no idea if it could be done in post-processing.
Posts: 12,706
Joined: Nov 2003
Reputation:
129
spiff
Team-Kodi Member
Posts: 12,706
possibly, but not while the code sits in the csc/scaling shader. i guess you could run a shader after we are fed the texture from the gpu, i dont know tbh
Posts: 44
Joined: Mar 2008
Reputation:
0
slight
Junior Member
Posts: 44
Oops, didn't receive a notification you'd posted again for some reason. I'll try this out asap and reply on trac.