This is a port of the OSL Sky Texture to the OpenGL viewport.
Attached below is a test scene. Just switch one of the 3D viewports to rendered mode and play with the texture values/camera.
Differential D2132
Enable Cycles Sky Texture in OpenGL viewport Authored by Ralf Hölzemer (cheleb) on Aug 1 2016, 9:57 PM.
Details
This is a port of the OSL Sky Texture to the OpenGL viewport. Attached below is a test scene. Just switch one of the 3D viewports to rendered mode and play with the texture values/camera.
Diff Detail
Event TimelineComment Actions It works great :) A pleasure to see Cycles viewport step by step closer to BI's viewport. Comment Actions Didn't apply or test the patch, but having copy of util_sky_model.{h,c} seems weak to me. First of all, it's not code we maintain, so technically it should be moved to extern/. Ideally we also need to de-duplicate it with Cycles, but that would make it more tricky to have standalone Cycles (tho, we've got third_party sources directory there already, so could be all fine but is out of the scope of this particular patch i think). That's current feedback against current master, Now, more tricky speculation. We are working on full viewport and render/shader integration, so not sure if this fits really well into our plans to move forward with 2.8 branch. This is where having some feedback from @Mike Erwin (merwin) will be really good ;)
Comment Actions I also have not tested this patch yet. Agree that we should have only 1 copy of this code, will leave it to @Sergey Sharybin (sergey) to decide where that single copy should live.
My first reaction is to put this in master for 2.79, then we can make necessary changes in the 2.8 branch to fit it into the (in flux) design. Shader gen for materials will be reworked for 2.8, but the GLSL itself will stay the same. Also to clarify about licensing and authorship: It looks like util_sky_model C files are from the researchers, GLSL and node setup is original code from @Ralf Hölzemer (cheleb). Is that correct?
Comment Actions I am against putting this into e.g. extern/. It's part of Cycles SVM/OSL shading system and we should not start outsourcing such things here imho. Then I'd rather have these files twice in the source tree (once Cycles, once GLSL). Comment Actions I'd also be inclined to just keep the file where it is, not sure putting it in extern/ actually makes things easier for anyone. Hopefully we can remove the Preetham model in Blender 2.8 as well, to simplify this code a bit. Comment Actions I also value simplicity. From a dev perspective it would be nice if the old model can be dropped and we have one "official" sky model. Do we know if the Preetham model is in wide use? On the other point: Having two different sky models seems ok though not ideal to me, but having two copies of the exact same code in Blender... seems like a problem we can (and should) solve. Cycles uses sky_model I'm ok with the sky_model code remaining in Cycles but accessible (via C) to the viewport shader gen function that also uses it. For builds with Cycles disabled, we can also disable shader gen for this node. Did I miss any issues here? Comment Actions There is already a patch for Eevee to port the Sky models from Cycles here https://developer.blender.org/D7108 | ||||||||||||||||||||||||||