I can't say I've really thought about using the standard library for handling HDR images, although I can definitely see how that could be useful. As you say it looks tricky to fit the expected colour.Colour behaviour, although there is 16bits to play with there?
Mostly I'd be looking to either export directly (e.g. as the Radiance HDR which is similar to your 4-byte RGBE(xp) format or hopefully into EXR using with OpenEXR bindings or preferably a native Go lib if I have time to write it) or tonemap into a lower bpp RGB or similar colour space (e.g. JPEG or PNG). In vermeer/math there is also a Half (16 bit) floating point type that could potentially be useful. Internally Vermeer uses Hero-wavelength full spectral sampling, upconverting any input RGB values into spectra and integrating them at the end for output. I've tried to make the colour library standalone in case the spectral and colour space functions are useful to someone. I've also tried to structure the whole thing as you suggest into a library so you can just add in the bits you want (e.g. geometry types, shader types), create the scene and call render which will then spit out a []float32 image for further processing. Admittedly it needs a bit more work before that workflow is straightforward :) Jamie On Tuesday, July 12, 2016 at 4:07:08 PM UTC+1, xiio...@gmail.com wrote: > > cool -. I've been using a very simple raycaster in go for a short while >> just for fun / test some visualisation ideas of mine -- one minor issue >> I've had is lack of native (standard library) support for hdr colors, as >> well as transparency (ie transparency != alpha blend) .. >> > > (my junk is not available anywhere because a. It's a mess I'm ashamed of > :) , and b. It doesn't have anything that isn't trivially > available elsewhere ) > > My current hdr-rgb fix kludges a 4 byte hd-RGB into 3 bytes > mantissa (r,g,b as uint8s) and a 4th byte exponent (as int8) - and then > squashes the 4th byte into the A channel of the standard library > color.NRGBA type -this saves me some time as I can use a few standard > library and additional packages for post-work without too much hassles. > I'll probably make a proper color.Color type at somepoint though the > required RGBA() method will need to be somesort of logarithmic kludge > > > *I think some people might appreciate your work as a package too*. Maybe > if it color output the rendered image as a [][]struct{R,G,B float32 etc} > for ease of post-processing/image conversion that could well be useful to > others. > > Keep up the good work. ! > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.