Hi,
Ready4Dis wrote:
Quote:
If the video driver wants to reduce a texture's quality (e.g. to make it fit in limited amount of VRAM) it can, and if the video driver wants to generate and use mip-maps it can. It's the video driver's responsibility to decide what the video driver wants to do. All normal software (applications, GUIs, games) only ever deal with the highest quality textures and have no reason to know or care what the video driver does with them..
I see, then is the user going to be able to set the graphics level based on the application? For example, one application has no problems running at super ultra awesome high quality, and another needs to run at low quality? I just think leaving to much up the video driver is going to make things run slower than they need to. If you enable mip-mapping (via toggle, slider, whatever) what if the application only wanted certain things to use mip-maps, and others not to (just one example of course)?
I don't just want to avoid/remove end user hassle (e.g. user should be able to install a game without setting anything at all); I want to avoid/remove software developer hassle (e.g. the game/app shouldn't know or care about "graphics quality vs. performance" because that's the video driver's job).
"Variable quality, fixed frame rate" means nothing will run slower than it needs to (it's the quality of the scene/frame that might be worse than necessary). If the video driver decides it has enough time and/or memory to generate mip-maps then it generates mip-maps. There's no "enable via toggle/slider/whatever" and the application doesn't get a say (and doesn't need to deal with the hassle of bothering to decide if/when mip-maps are used).
Ready4Dis wrote:
Quote:
Part of my project is to fix the "many different file formats" problem; where new file formats are constantly being created and none are ever really deprecated/removed, leading to a continually expanding burden on software and/or "application X doesn't support file format Y" compatibility problems. Mostly I'll be having a small set of standard file formats that are mandatory (combined with "file format converters" functionality built into the VFS that auto-convert files from legacy/deprecated file formats into the mandatory file formats).
Yes, I like this idea, but it's hard for some things unless you have a very clearly defined internal representation for all the 'formats'. By that I mean a clearly defined bitmap structure that any format can load/save to/from, a text format that supports all the advanced features (bold/italics/underline, coloring, hyperlinks, embedded images?, fonts, etc). That idea I do like and plan on doing something very much like it in my own OS. I don't think each application needs to have it's own jpeg loading routine or link to a library to load a file. It should just open it and get an image out, or tell the video driver to map a .jpeg into a texture without worrying about it.
Yes; but note that in my experience designing things like this takes a considerable amount of research and time, and tends to be intertwined with other things in ways that aren't immediately obvious.
Ready4Dis wrote:
Quote:
Heh. The plan was to define a "monitor description" file format (capable of handling curved monitors, colour space correction, 3D displays, etc); and then write boot code to convert the monitor's EDID into this file format (and I did a whole bunch of research to design the "monitor description" file format, and wrote out most of the specification). However; to convert the colour space data from what EDID provides (co-ords for CIE primaries) into something useful involves using complex matrix equations to generate a colour space conversion matrix; and my boot code is designed for "80486SX or later" and I can't even assume an FPU or floating point is supported. This mostly means that to achieve what I want I need to implement a whole pile of maths routines (e.g. half an arbitrary precision maths library) in my boot code before I can even start implementing the code that generates the colour space conversion matrix.
I have written a few colour space conversion routines for a project I was working on. It supports HSV, YCbCr, and regular RGB. I had support for YUV but it's basically the same as YCbCr (redundant) so I removed it. I actually removed a few now that I am looking back. HSL was removed, YUV removed conversion to CIE LUV and CIE LAB was removed... meh, oh well.
If you're given (e.g.) a predefined colour space conversion matrix it's fairly easy to do colour space conversion. Generating a colour space conversion matrix from arbitrary primaries is "less easy".
Ready4Dis wrote:
Do graphics from the 486 era even support EDID?
No; but there are far more recent 80486SX clones. One of my test machines (an
eBox-2300SX) has full VBE with EDID and no FPU.
Ready4Dis wrote:
Is it really necessary to support that in the boot loader? If you ever want a hand with anything like that, I enjoy low level driver/graphics stuff more than kernel development
. I've written a 3d rendering engine on a 486 sx (no FPU) and used tons of fixed point math before. Although, my colour conversion routines weren't meant for real-time so they are just floating point and no optimizations.
I don't know about necessary. The "EDID to my monitor description" conversion has to be done somewhere (even if that means keeping EDID around during boot so it can be handed to a utility after boot); and if the early boot code does it then all later code (including the code to select a video mode during boot and the code that generates graphics during boot) only has to worry about using my monitor description and doesn't have to support both EDID (in case my monitor description isn't present in the boot image/init RAM disk) and my monitor description.
If you're interested...
The idea is to find a set of 9 formulas that generates a matrix. The input variables for these 9 formulas are CIE co-ords for 3 primaries and white point, which is the 8 variables Xr, Yr, Xg, Yg, Xb, Yb, Xw, Yw (there is no Zw which is needed later and I forgot the work-around for that problem).
In other words, I'm looking for functions fn1 to fn9 in this matrix:
Code:
| fn1(Xr, Yr, Xg, Yg, Xb, Yb, Xw, Yw), fn2(Xr, Yr, Xg, Yg, Xb, Yb, Xw, Yw), fn3(Xr, Yr, Xg, Yg, Xb, Yb, Xw, Yw) |
| fn4(Xr, Yr, Xg, Yg, Xb, Yb, Xw, Yw), fn5(Xr, Yr, Xg, Yg, Xb, Yb, Xw, Yw), fn6(Xr, Yr, Xg, Yg, Xb, Yb, Xw, Yw) |
| fn7(Xr, Yr, Xg, Yg, Xb, Yb, Xw, Yw), fn8(Xr, Yr, Xg, Yg, Xb, Yb, Xw, Yw), fn9(Xr, Yr, Xg, Yg, Xb, Yb, Xw, Yw) |
Once these functions are found; I'd be able to plug the values from any monitor's EDID into them and generate a matrix that does "XYZ with D65 whitepoint to monitor's RGB colour space" that includes colour space conversion and chromatic adaption for that monitor.
The maths for generating the colour conversion matrix (without chromatic adaption) is described at the top of
this web page; except it does the reverse of what I want (generates an RGB->XYZ conversion matrix) and needs to be inverted to get the XYZ->RGB matrix.
The maths for generating the chromatic adaption matrix is described at the top of
this web page. I've chosen to use the Bradford method (ignore XYZ scaling and Von Kries).
Of course the set of 9 formulas would need to be simplified as much as possible; then any common sub-expressions identified and lifted out; then the whole mess would be analysed to determine the effective range and precision needed at each step (in preperation for implementing them as fixed point integer maths, hopefully).
Please note that the only reason I haven't done this already is that I've been lazy.
Cheers,
Brendan