Search Unity

Ocean Renderer

Discussion in 'Works In Progress - Archive' started by scrawk, Feb 24, 2013.

  1. carl010010

    carl010010

    Joined:
    Jul 14, 2010
    Posts:
    140
    This is amazing, really good job on this scrawk. Keep up the good work.
     
  2. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    Yes. Not all combinations of number will make valid results. Its just the limits of the math used, it breaks down when wind speed, wave amp or decay factor are above/below certain values. It hard to determine the exact limits as they are all co-dependant. You will just have to avoid setting wind speed that low.

    Oddly a wind speed below 2.6 works fine with a fourier grid size of 128 but not at 256.

    If your trying to get a still pond type effect by turning down the wind speed try lowering it to 2.7 where it still works then lower the wave amp to say 0.1 to make the water surface even smoother.

    Ive tried my best to make it as easy to use as I can but there my still but some bugs and issues.
     
    Last edited: Jul 8, 2013
  3. eskovas

    eskovas

    Joined:
    Dec 2, 2009
    Posts:
    1,373
    Hello there.

    First of all, this looks amazing.
    I was trying to implement this in our game, to see how it would look like and maybe use it in our game, but i found out that it doesn't work in linear space... it only works in gamma space. Is there a way you can make it work in linear space?

    I also wanted to ask if there are any requirements to use this package in a game?
     
  4. Ethaninja

    Ethaninja

    Joined:
    Jan 7, 2013
    Posts:
    277
    My god this is the most beautiful thing I've ever seen! Is this all mathematics and programming?
     
  5. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    Yes. Someone has pointed that out. To be honest I have no idea why. Im not very experienced with color spaces. Im sure its something simple, there's no reason way it shouldnt work.

    Yes, you can use it in a game if you want. It needs a SM3 at a minimum and the card needs to support floating point texture and multi-target blit.

    In general Im not offering a perfect program you can just drag into your game and away you go (which is why its free). If you want to use it in a game you my still need to solve some issues. The physics on the ocean surface is a bit of a problem with the pro version. I think the best way to solve this is to do a second low res fourier transform of only the heights on the CPU from a C++ dll were you can get the wave heights for physics. PM me if you need help with that.

    Yes.

    Just on a side note. I am still working on this project and other ocean related stuff but I am currently working on something else so it could be a while before I make any up dates on this project.
     
  6. Dabeh

    Dabeh

    Joined:
    Oct 26, 2011
    Posts:
    1,614
    Looks amazing, sad about the physics on the pro version though. I might download it and see if I can wrap my head around it enough to hack a version with wave heights. I expect to fail xD.
     
    Last edited: Jul 11, 2013
  7. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    Good luck Dabeh.

    Since I havnt updated this project in a while Ive decided to do some work on it this week.

    First off, solve the issue with getting waves heights on in the Pro version. Im going to do a second fourier transform on the CPU to get just the heights. Ive already set this up this afternoon and with running a 128 fourier grid on the GPU and CPU at the same time I have a frame rate of 65 fps which is promising considering I havent optimized it yet. I think I can optimize this a lot further since only a small amount of data needs to be transform to get the heights and I may be able to use a lower res grid like 64 and stage the transform over a few frames.

    Secondly I am going to remove the wind speed, wave amp and wave age variables and replace them with a single wave condition value that you can slid from 0 to 1 for still to rough conditions. I will also make this adjustable during game play so you can dynamically change the waves depending on weather conditions.

    Ive also had a look at the shader. Im not that happy with it, may make some changes. Ive already changed to a blurred sky dome for the sky reflection which gives the ocean a smoother nicer look.

    I will have a look at the linear/gamma color space issue but Im not sure I know how to solve that.

    Any other requests now's the time to speak up.

    Im not doing refraction or under water effects in this update. That will have to wait, I dont really have the time for that atm.
     
  8. Elehe

    Elehe

    Joined:
    May 19, 2013
    Posts:
    14
    I didn't take a closer look into your code but i think you can get much better framerate when you use computeshaders and that will give you the ability to store your data in buffers instead of render textures so the indie version becomes a lot more faster. This might solve your height calculation problem as well.
     
  9. ronan-thibaudau

    ronan-thibaudau

    Joined:
    Jun 29, 2012
    Posts:
    1,722
    I'm a bit confused, those changes all sound like downgrades to me (or at best sidegrades)?
    For the GPU=>CPU unless it's optional it's a downgrade for everyone who doesn't care about retrieving wave heights (a pretty massive one too perf wise!)
    For the parameters => less flexibility (changing at runtime is good but i'd rather keep all parameters and have all of them updateable)
    For the blurred sky => it could look both better or worse, but is going to have it's own style, doesn't sound like something i'd like in a generic tool, but that i'd add myself if i wanted the specific style (i don't think it'll look better, it'll look different)
     
  10. Breyer

    Breyer

    Joined:
    Nov 10, 2012
    Posts:
    412
    hmmm u plan add wind direction ? (or optional module - like advanced settings - which can use directional wind zone)

    thx for reply and awesome work
     
  11. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    Never mind, they were all crazy ideas. Turns out Im not going to have much spare time anyway.

    It would solve the get heights issue. You could use a structured buffer for that, The rest of the code still needs to be written to render textures as buffers dont support filtering or mipmaps (as far as I know) so would still be Pro.

    not at the moment sorry.
     
  12. MickM

    MickM

    Joined:
    Nov 19, 2012
    Posts:
    166
    Gday mate

    50fps on webplayer - Looks amazing.... Makes me wonder what technology could be like if they pooled everyone at the top of their fields together internationally.... (Guess that is the same for any industry)

    Still... amazing work! Pity it sounds like you have other stuff on your plate at the moment but I am sure that is equally as impressive!

    Only improve comment I have - The light from the sun on the water (which looks amazing!) is actually at the wrong angle to the sun in the scene (ie. If you line up the sun reflection on the water to the horizon, the sun in the webplayer is actually to the high left of where it should be - Not sure if the light is automatically calculated from the sun in the scene or if the sun in the scene is just for show though)
     
  13. eskovas

    eskovas

    Joined:
    Dec 2, 2009
    Posts:
    1,373
    I switched to gamma space just to see how the ocean would look like, here's the result:





    With a little more tweaking, it would look way better.
    We might use this if you can make it work in linear space.
     
  14. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    Looks great eskovos. Looks better with a lighter ocean color. I probably made the default color a bit to dark.

    MicKM, do you mean the sun in the sky map? The sun in the sky map is just for show. I tried to line them up but its a bit hard to get it 100%.
     
    Last edited: Jul 14, 2013
  15. MickM

    MickM

    Joined:
    Nov 19, 2012
    Posts:
    166
    Yea was referring to the skybox one - Wasn't sure if it was tied to a directional light that influenced the light on the waves or not. Is the lighting on the waves a set value or could it be tied in to external factors?

    But related note - the lighting effect on the waves looks almost photo realistic... great work!
     
  16. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    Thanks Mick. There's a game object in the project called sun and its just a directional light. The light on the waves is based on that lights direction.

    Fixed the linear/gamma space issue. Turns out that if you enable linear color space you need to set isLinear to true on any 8 bit textures you are rendering data into that is not color information. This will prevent gamma correction being applied to the data which would not make sense if the data is not a color.

    I have updated all three projects (Indie, Pro and BRDF) to fix this. If you dont want to redownload them there's 1 texture in the Fourier.cs script and 4 in the encodeFloat.cs script that need to have this enabled.

    Enabling linear color space makes the colors look a bit washed out but I guess this is what you would expect when changing color space. For the Indie and Pro project you will need to use a sky map for the sky reflection that has not had gamma correction applied to it.

    Its a little more complex for the BRDF project since all the colors are determined from calculations and there are no textures. There needs to be a correction factor applied to the final color but I am not sure what this needs to be at the moment. The important thing is that the wave calculations all work correctly now.

    Ive played around with some other features but have not had much luck. Ive tried retrieving the wave heights by using a computer shader to write them into a structure buffer but getting the data back to the CPU made the frame rate go from 90fps to 60fps. I knew it would be costly but not by that much. That was only retrieving two 16 bit channels from map0 which contains the heights the verts are displaced from.
     
  17. eskovas

    eskovas

    Joined:
    Dec 2, 2009
    Posts:
    1,373
    Thanks for fixing the problem with linear space.
    Here's how it looks like now:






    It also didn't have much effect on performance (i also decreased the quality a bit).
    All in all, this is an amazing asset and thanks for sharing it :)
     
  18. Frostbite23

    Frostbite23

    Joined:
    Mar 8, 2013
    Posts:
    458
    hello! i've tried the ocean shader. its amazing.

    is the ocean shader effected by lights (like has a specular for a different light rather than just the sun)
    if not you should do it. (just a suggestion)

    Keep up the great work!
     
  19. will_jones

    will_jones

    Joined:
    Dec 20, 2011
    Posts:
    80
    Latest MBP Retina here and its 60fps indie webplayer version. Looks awesome!
     
  20. Venturia

    Venturia

    Joined:
    Jul 22, 2013
    Posts:
    7
    First of all...thanks a lot for this shader it looks amazing :)

    The only problem I have is with the Pro version...the Indie version works fine after the program was assembled. In the Pro version it works great in the development environment...but the moment a stand-alone pc version is compiled the ocean are not there at all when its run outside the development environment. I have also moved all the shaders to the Resources folder etc but I can't seem to find the problem. If I replace it with the Indie version in the same project all runs fine outside the development environment. Any ideas maybe?
     
  21. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    Thanks. Thought I checked that. Guess not. I will look into it.

    The build is working in dx11 but not dx9 so that narrows it down a little. The addBuoancy script is not working in dx11. not sure why.
     
  22. Venturia

    Venturia

    Joined:
    Jul 22, 2013
    Posts:
    7
    Thanks...I have started narrowing it down (against the indie and DX11 versions) as well trying to find the problem but still can't get it...I am sure its something minute.

    I know the Ocean and OceanWireFrame shaders are running fine because when I compared it to the Indie version looking for differences they are the same..and just to verify when dropping them onto a different object as a material shader without C# scripts etc it still displays that object outside the development (ie 2 main shaders fine) but still no ocean. I started also comparing against the DX11 version and eliminated those shaders that are the same...BUT wasn't sure if its dangerous doing that due to that it might be a DX9 issue that gets triggered but not sure?

    If I find the problem I will let you know as well...
     
    Last edited: Jul 24, 2013
  23. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    Thanks Venturia. I think I might know what the issue is but wont get time to look at it until next week.

    This is a unrelated project I have just finished called interactive erosion but it does contain some water rendering so I thought it maybe of some interest for people following this thread.

    $InteractiveErosion10.jpg
     
  24. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    Fixed the issue with the dx9 build not working and have updated the project files.

    The issue is that in a Unity dx9 build the graphics blit function has no effect on the first frame. I use the blit function to initialize some data into a render texture and this data was just not being written to.

    To solve this I created a init function thats gets called on the second frame to initilize all the needed render textures instead of doing it in the objects constructor that is being created on the first frame.

    I have encountered this with the web player but didnt know it happens in the dx9 build as well. I dont know if its a bug in Unity or if its just meant to be that way. This does not happen in the dx11 build.

    I have also fixed the issue with the black spots on the backs of waves (not in the BRDF ocean, that a different issue) and have fixed a precision issue that was happening on some cards.
     
  25. Venturia

    Venturia

    Joined:
    Jul 22, 2013
    Posts:
    7
    Thanks a million...I downloaded it, tested it and it works perfect. I really appreciate your efforts and sharing this with us :)
     
  26. Luckymouse

    Luckymouse

    Joined:
    Jan 31, 2010
    Posts:
    484
    Thanks scrawk, great stuff on your blog. Too bad i'm using mac and don't have any DX11 hardware to test your project.
    Just play around the non-dx11 projects. it is amazing. I hope unity can support better Texture3D on Mac in the future.

    By the way, have you check out this site: http://reset-game.net/?p=284#more-284.

    They use the same Precomputed Atmospheric Scattering technique for their sky lighting, and it is beautiful.

    It is their video link http://www.youtube.com/watch?v=0ygZCDoCVec
     
    Last edited: Aug 24, 2013
  27. Luckymouse

    Luckymouse

    Joined:
    Jan 31, 2010
    Posts:
    484
    I converted the Precomputed Atmospheric data from inscatter.raw to a 2D lookup texture (LUT). Load it directly and convert it to Texture3D from script. This method is the same as 3D Color Correction used in Unity Image Effect. The reason i use this way that we don't need to use the DX11 for the RenderTexture3D and it is Mac compatible.

    This 2D lookup texture is a 32 bit float point EXR format imported as ARGB32 format in Unity. It is very low resolution compare with original one, but it gets identical visual result.

    $inscatter1Table16x1.jpg
    2D lookup texture is 1 table 16x16x16 . (original: 8 table 256x128x32)

    Here is the SceenShot that using Low Res LUT
    $01.jpg
    $02.jpg
    $03.jpg


    PS:
    I did try the higher resolution 2D lookup texture, but actually I got worst result. Maybe here we are using 8bit per channel instead of 32 bit float point 3D texture.

    Further i need to figure out how to do the non DX11 3D texture for Ocean shader
     
    Last edited: Aug 20, 2013
  28. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    that's pretty cool, so it will work in dx9? but what the catch? is it possible to share it?
     
  29. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    Very clever. PS thanks for that link, that blog was very interesting.

    Im guessing you mean the variance texture? You can calculate the variance from a script instead of a compute shader but the results dont look very good in a 8 bit texture.

    I may as well give a bit of a update on what Im working on since Ive made this post.

    For a start I have found another of Eric Bruntons ocean projects that Im porting to Unity. This one is called "Real-time Animation and rendering of whitecaps" and is much like the ocean BRDF project but with white cap waves. I think it will be quite demanding to run and will be more of a demo project. You will be lucky to get 60 fps out of it. Im hoping to use some of its feature in a up coming project. Will have that done in a week or so.

    Secondly I was planning on the next ocean project to be a under water effects project but I dont feel like I have addressed the ability to get the oceans height from a script in the other projects.

    I have been thinking about this and have come up with a solution and am going to do a ocean physics effects project. Basically I have combined the fourier transform method with some more traditional methods.

    The other projects had some larger waves that displaced the ocean surface and some smaller waves the dont displace the surface but add detail to the normal maps.

    For the new project the larger waves are created by precomputed tiled textures and as you have a copy of the texture data you can calculate the exact wave heights from a script with out needing to get any data from the GPU.

    The smaller waves are calculated by fourier transform like before and add the extra detail to the normal maps to remove any tiling artifacts.

    Visually this the new project looks almost exactly like the last one (even a bit better in my opinion) and since there is less data to calculate runs faster (about a extra 10-20fps). Although I will probably use the extra frames to add some new effects like foam and boat wakes.

    I already have a working copy and will have it finished in the new few weeks hopefully. I will include a copy of the code to generate the precomputed wave files so you can change the look of the waves if you wish.
     
  30. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    Done this. Didnt take as long as I thought it would. Link in first post as usual.

    $OceanWhiteCaps0.jpg
     
  31. Breyer

    Breyer

    Joined:
    Nov 10, 2012
    Posts:
    412
    Wow! Whitecaps can be ported to indie version? or not because it use special technique (only whitecaps ofc)?
     
  32. Luckymouse

    Luckymouse

    Joined:
    Jan 31, 2010
    Posts:
    484
    $Screen Shot 1.jpg
    $Screen Shot 2.jpg

    Yes, it works with DX9 and MacOSX.

    Before I try to write the script to do the variance 3D texture, then I found out that actually I don't really need the variance 3D texture and It seems still working, but may lost some details. So right now it is just a quick and dirty solution for the ocean;)

    It is Ocean BRDF (NO White caps) for DX9 and MacOSX
    Updated: removed the file links

    Other change:
    1. Basically everything is using as 8bit per channel. (except the skyMap renderTexture)
    2. I converted all the raw files to EXR format. It bypass almost all Encode/Decode process from precomputed data. Slightly faster loading at startup.
    3. As I mention earlier post that the inscatter.exr file is a 2D Look Up Texture, it will convert to 3D Texture via the Script (Not shader).
    4. Changed all the shaders from SM4 to SM3 (My Macbook Air doesn't support SM4.)
    Somehow the New White Caps project is not working on my Macbook Air, even I stripped all the DX11 code. the white caps rendered as black blocky thing. Not sure what happen.
    $Screen Shot 3.jpg
     
    Last edited: Sep 14, 2014
  33. alexzzzz

    alexzzzz

    Joined:
    Nov 20, 2010
    Posts:
    1,447
    Windows 7 x64, Radeon HD6950, Catalyst 13.4

     
  34. ZJP

    ZJP

    Joined:
    Jan 22, 2010
    Posts:
    2,649
    Same result in fullscreen.Windows7 x32, Nvidia 9800GT drivers 320.49
     
  35. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    Nice work lucky mouse. Im impressed you got the shader into SM3. So Unity can load a .exr file straight into a 16/32 bit render texture? Or does it end up as a 8 bit texture?

    There seems to be a floating point precision problem with the new white cap project. Its only happening on some cards which makes it hard to track down. Its not happening on my card which makes it very hard for me to fix but I am looking into it.

    If someone who is having trouble can go into the waveSpectrum script and change all the render textures precision to Float and so what happens. If that does not work can you go into the ocenWhiteCap shader and comment out any contibution from texture Map0, check if the problem goes away, if it does not comment out Map1, check again, etc.

    The new maps added in this project are maps 4 - 6 and foam 0 - 1. The problem will probably be with one or more of them
     
    Last edited: Aug 24, 2013
  36. Luckymouse

    Luckymouse

    Joined:
    Jan 31, 2010
    Posts:
    484
    Very pitty, the answer is "no". Although original source .exr file is 16/32 bit per channel, but right after it imported to unity it will be an ARGB32 format as the Texture asset (The highest bit rate uncompressed format). Which it end up as a 8bit per channel texture:(. You are still right, unity doesn't support any floating point format for texture asset at the moment, except RenderTexure.
     
    Last edited: Aug 24, 2013
  37. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    Ah, ok. You had my hopes up for a minute that there was some way I had over looked to load floating point textures.

    Had a look at your code. Realizing that the variance could be a constant value was genius. I had looked at that before but could never find a value that worked.

    I should have mentioned this before but had completely forgotten about it until now. If I remember correctly the first layer of the inscatter texture can be used with good results. This means you can just load the first layer of the 3d data set into a 2D floating point render texture in dx9 using the same encode method as the other 2d textures. It does mean only the scattering at ground level can be computed but it doesnt really effect the results unless you wanted to use it in a flight sim.

    I never really thought to much about it because I didnt think it possible to get the rest of the project to work in dx9. I really never thought the shader would fit into a SM3 instruction set or the variance texture could be removed.

    EDIT - oh, and if you only use the first layer of the inscatter texture you cant compute the scattering between two points so this will not work in the 'Precomputed atmospheric as a post effect project'
     
    Last edited: Aug 24, 2013
  38. janpec

    janpec

    Joined:
    Jul 16, 2010
    Posts:
    3,520
    Screens look amazing, but webplayer is corrupt, same problems as described above. Please fix it so we can enjoy your work:D
     
  39. drcool

    drcool

    Joined:
    Aug 22, 2013
    Posts:
    14
    You are amazing
     
  40. Eqric

    Eqric

    Joined:
    Jun 29, 2012
    Posts:
    51
    I have the same problem...I also have a AMD graphic card HD69xx serie
     
  41. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    If anyone has I problem can they please state what project it is in, ie white caps, BRDF, surface effect. Its getting hard to keep track off. Im guessing those screen shots where of the white caps project.

    I may have fixed the issue in white caps project so if you have had trouble try downloading it again.

    Is that the web player in the surface effects Pro project?
     
  42. alexzzzz

    alexzzzz

    Joined:
    Nov 20, 2010
    Posts:
    1,447
    The first three shots are from "Ocean white caps",
    the last one is from "Ocean with BRDF lighting" web player (the standalone build has the same problem).
     
    Last edited: Aug 24, 2013
  43. Luckymouse

    Luckymouse

    Joined:
    Jan 31, 2010
    Posts:
    484
    Yes, getting so confusing. Just wondering anyone has problem with the webplayer or project from Ocean BRDF DX9 MacOSX version?
     
  44. Eqric

    Eqric

    Joined:
    Jun 29, 2012
    Posts:
    51
    I have the same graphic gltich on all the DX11 oceans. DX9 works just fine.

    I will try the new build when i get home.
     
  45. Eqric

    Eqric

    Joined:
    Jun 29, 2012
    Posts:
    51
    Ok i tried the new version of D11 ocean with white caps. Still the same graphic glitch.
    $Glitch.png
     
  46. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    Ok, thanks. The update did fix some issues some people where having but not the issue your having for some reason. If you see the ocean surface all messed up like that it means there is a issue with the fourier transform stage. For some reason there are precision issues with some peoples cards.

    I will so what I can do but I am running out of ideas. At least the dx9 project works, which is a bit odd because a lot of the code is the same.

    Eqric if I PM you a link to download a test build can you tell me if it works for you?
     
  47. Eqric

    Eqric

    Joined:
    Jun 29, 2012
    Posts:
    51
    Yes, i am happy to help.
     
  48. Luckymouse

    Luckymouse

    Joined:
    Jan 31, 2010
    Posts:
    484
    I'm trying to make the White Caps project to DX9. The choppy wave works fantastic and everything else works fine without white caps(Edit: manually disabled the white caps code).
    Inside the OceanWhiteCaps.shader that _Foam0 and _Foam1 seems look correctly when view them as individual texture, however after they add up as:
    Code (csharp):
    1.         float2 jm  = jm1+jm2+jm3+jm4;
    2.         float jSigma2 = max(jm.y - (jm1.x*jm1.x + jm2.x*jm2.x + jm3.x*jm3.x + jm4.x*jm4.x), 0.0);
    Then they just seem totally mess up as blocky textures.
     
    Last edited: Aug 27, 2013
  49. Luckymouse

    Luckymouse

    Joined:
    Jan 31, 2010
    Posts:
    484
    Actually i did use the renderTexture for the first layer of the inscatter as 2D texture for testing when i was trying to convert it to 2D lookup texture. You are correct that first layer works just fine. At least i mostly tested on ground level.
    I didn't know first layer is related to ground level only, I always wonder if the first layer is just work then what is all other layer for. Now i understand it much clear with your explanation, thanks scrawk.
    Since i haven't work on your Precomputed atmospheric as a post effect project, and now I'm so curious that i'm not sure my 2D LUT completely cover for all atmosphere level. Anyway I will found out that with your post effect project sooner or later.

    I converted the inscatter.raw from photoshop import. It also need some manual work to convert as 2D LUT format.
    I personally don't mind to work on 8 bit texture without too much sacrificed the visual quality. So far im happy with that low resolution 2D LUT results. My goal is make it to mobile version if possible. I know sounds crazy. I think I may found the way already. I can just use 2D lookup instead of the 3D texture for inscatter data.

    Btw, while ago i wrote a custom lightshaft post effect with volume shadow. Which mean it is not only cast the shaft by brighten the sky( it is what the built-in sunshaft does), it also darken the occluded area to create volume shadow effect. The effect is basically identical to Lightshaft in UDK. It is already tested and supports on mobile. i gonna test it with this precomputed atmospheric sky, and maybe the Skyshop IBL later too.
     
    Last edited: Aug 28, 2013
  50. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    Ok, thanks to Eqrics help I think I have fixed the issue some people where having with the BRDF and white cap projects and have up dated the project files.

    Since the results are squared I think precision becomes a problem. I did change the foam textures format to float in a previous update and that seemed to fix the issues some people where having with that. If this still doesn't fix the issue in dx9 im not sure what will. EDIT- I have changed the map format to float in the latest update, that might fix it.

    For the inscatter texture the 4 layers are based on height, view angle, sun zenith and angle between the viewer and sun. I recommend having a look at Erics artcile on this (found here) if you havnt already.

    I will be supprised if you can get this to work on mobile but good luck anyway.
     
    Last edited: Aug 29, 2013