Gandi Posted January 18, 2010 Share Posted January 18, 2010 I just created an ocean which doesnt need any vertices.. it's all computed as a post process.. for the wave generation i use a heightmap (which still needs some work) Here you can see my first attemts to rendering some kind of specular color from the sun ( needs a lot of tweaking) If you directly look down the water you can see the refracted part + some caustics The shore gets some foam and some blending. furthermore the parts very close to the water get some highlighting ( i dont know if i maybe should remove that) Also high waves get some foam on top of them For reflection i currently only use the sky, but it shouldnt be a problem to reflect the whole scene ( i just dont think its worth it) I'm still working on it and its far from being perfect.. Quote Link to comment Share on other sites More sharing options...
AggrorJorn Posted January 18, 2010 Share Posted January 18, 2010 its looking realy nice Gandi, Did you write a new shader for this? How high do you think you can make the waves? Quote Link to comment Share on other sites More sharing options...
dreamhead Posted January 18, 2010 Share Posted January 18, 2010 looks very beautiful,will you give it free or just for private use,but great work mate Quote the real world is in my head CPU-Intel® Core2 Quad CPU Q6600 @ 2.40GHz CPU Speed 2.40 GHz RAM 3.5 GB OS Microsoft Windows XP Professional (Build Service Pack 32600) Video Card GeForce 8800 GT Video Card Features- *Video RAM 512.0 MB Video RAM 256 MB 512.0 MB Hardware T&L Yes Pixel Shader version 3.0 Vertex Shader version 3.0 using:leadwerks2.3,2 [ Link to comment Share on other sites More sharing options...
Pixel Perfect Posted January 18, 2010 Share Posted January 18, 2010 It does look promising! What's the heightmap actually used to manipulate then if there are no vertices? Quote Intel Core i5 2.66 GHz, Asus P7P55D, 8Gb DDR3 RAM, GTX460 1Gb DDR5, Windows 7 (x64), LE Editor, GMax, 3DWS, UU3D Pro, Texture Maker Pro, Shader Map Pro. Development language: C/C++ Link to comment Share on other sites More sharing options...
Sooshi Posted January 18, 2010 Share Posted January 18, 2010 that looks good man, a texture for the sand will top it off... Quote Working on a major RPG project.......will showcase soon. www.kevintillman1.wix.com/tillmansart Link to comment Share on other sites More sharing options...
Gandi Posted January 18, 2010 Author Share Posted January 18, 2010 its looking realy nice Gandi, Did you write a new shader for this? How high do you think you can make the waves? Y.. i wrote a new shader for it.. atm it works this way: render world/reflection render lights render ocean render postprocess theoretically i guess you can make them any height, but atm it just works if you stand above watersurface+waveheight. looks very beautiful,will you give it free or just for private use,but great work mate dont know that yet, but im creating this mainly for a game im working on It does look promising! What's the heightmap actually used to manipulate then if there are no vertices? well i somehow have to create the waves ^^ its just a rgba image which holds the normals and the height of the waves. I'd prefere the wave generation with FFT but 1) i think im too stupid for it ^^ 2) i think its to much maths to do for every pixel which could be under the watersurface... Quote Link to comment Share on other sites More sharing options...
klepto2 Posted January 18, 2010 Share Posted January 18, 2010 WOW, looks really nice. Nice to know what you needed the shader pix to worldpos code for Some questions How will physics work together with this? Did you think about to use some region mapping eg a modified heightmap/alphamap where you can setup lakes in different heights? Quote Windows 10 Pro 64-Bit-Version NVIDIA Geforce 1080 TI Link to comment Share on other sites More sharing options...
L B Posted January 18, 2010 Share Posted January 18, 2010 Nice work. The foam is brilliantly added, although you need much more turbulence, and maybe some more "transparency". I don't know, doesn't look like much of a fluid to me. Quote Link to comment Share on other sites More sharing options...
Qbound Posted January 18, 2010 Share Posted January 18, 2010 Hey Gandi, nice work man... Does this work with meshes aswell? (bridges and so on?) cu Oliver Quote Windows Vista 64 / Win7 64 | 12GB DDR3 1600 | I7 965 | 2 * 280GTX sli | 2 * 300GB Raptor | 2 * 1.5TB Link to comment Share on other sites More sharing options...
Pixel Perfect Posted January 19, 2010 Share Posted January 19, 2010 well i somehow have to create the waves ^^ its just a rgba image which holds the normals and the height of the waves. I'd prefere the wave generation with FFT but 1) i think im too stupid for it ^^ 2) i think its to much maths to do for every pixel which could be under the watersurface... Cool ... so this is done with a frag shader then. Certainly the static pics show nice looking waves although it's a bit hard to get a feel for how good the effect is without seeing some video. Looking forward to seeing more! Quote Intel Core i5 2.66 GHz, Asus P7P55D, 8Gb DDR3 RAM, GTX460 1Gb DDR5, Windows 7 (x64), LE Editor, GMax, 3DWS, UU3D Pro, Texture Maker Pro, Shader Map Pro. Development language: C/C++ Link to comment Share on other sites More sharing options...
Sooshi Posted January 19, 2010 Share Posted January 19, 2010 Yea man I wna see a video, show muah Quote Working on a major RPG project.......will showcase soon. www.kevintillman1.wix.com/tillmansart Link to comment Share on other sites More sharing options...
Rick Posted January 19, 2010 Share Posted January 19, 2010 Wow. See this is what I'm talking about. Freaking shaders. I really don't want to learn you! Quote Link to comment Share on other sites More sharing options...
Rekindled Phoenix Posted January 19, 2010 Share Posted January 19, 2010 This is awesome. Foam and caustics are a nice touch. I sure hope this will be released for the LE community! Quote Link to comment Share on other sites More sharing options...
Gandi Posted January 19, 2010 Author Share Posted January 19, 2010 ok.. i made some changes on it.. now i just got the problem.. i wanna transform the normals into tangent space.. therefor i have to compute the tangentspace from: Normal, View-vector, UV i got this formula: float3x3 compute_tangent_frame(float3 Normal, float3 View, float2 UV) { float3 dp1 = ddx(View); float3 dp2 = ddy(View); float2 duv1 = ddx(UV); float2 duv2 = ddy(UV); float3x3 M = float3x3(dp1, dp2, cross(dp1, dp2)); float2x3 inverseM = float2x3(cross(M[1], M[2]), cross(M[2], M[0])); float3 Tangent = mul(float2(duv1.x, duv2.x), inverseM); float3 Binormal = mul(float2(duv1.y, duv2.y), inverseM); return float3x3(normalize(Tangent), normalize(Binormal), Normal); } (this is hlsl :-/ but i just dont get it to run properly.. 1 Quote Link to comment Share on other sites More sharing options...
Guest Red Ocktober Posted January 19, 2010 Share Posted January 19, 2010 ooooo... ooo, oooo!!!! verrrrry nice stuff G.... real waves.... yess... --Mike Quote Link to comment Share on other sites More sharing options...
macklebee Posted January 19, 2010 Share Posted January 19, 2010 looks nice gandi... what kind of fps hit are you getting with this? meaning whats your fps without the water and whats your fps with the water? Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
Gandi Posted January 19, 2010 Author Share Posted January 19, 2010 Got 70 frames with or without the ocean... (guess vsync is on) €: If anyone got an idea how i could add the normals from the normalmap, just tell me I compute the main normal from the heightmap, and i got a normalmap with the finer normals which don't really affect the "geometry" Quote Link to comment Share on other sites More sharing options...
macklebee Posted January 19, 2010 Share Posted January 19, 2010 you have probably already done this... but have you looked at the terrain shaders? sorry.. not much help on shader coding... Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
Gandi Posted January 19, 2010 Author Share Posted January 19, 2010 at the terrain shader there is the T B N matrix for the transformation from the vertex stage normal = T * bumpnormal.x + B * bumpnormal.y + N * bumpnormal.z; i tried to create this matrix, but i failed :-/ Quote Link to comment Share on other sites More sharing options...
Josh Posted January 19, 2010 Share Posted January 19, 2010 The edges look like Crysis water. I don't know why, but I could just never get ocean water quite right. If you can find a good-looking surface pattern to add all over the surface, it will make the deep-water areas look a lot better. Are you trying to write the normals out to the screen? Why not just use the normal map and calculate the dot product of the normal and the directional light vector, and write out the brightness? I assume you are rendering this after the main lighting pass. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Gandi Posted January 19, 2010 Author Share Posted January 19, 2010 y.. i render it like a post process... i need to compute the right normals, thats the problem.. atm i only got the normals computed from the height, but i wanna add some detail normals from a normalmap to them (just like bumpmaps on the terrain), so i have to align the deatil normals to the computed ones.. thats where im stuck.. i need the normals for calculating refraction/reflection and for the specular from the sun Quote Link to comment Share on other sites More sharing options...
Josh Posted January 19, 2010 Share Posted January 19, 2010 I am not sure exactly what you are doing, but let's say you have a heightmap. It's easy to make a normal map out of that, and read that texture for the normal, instead of calculating it in the shader from the height. Now you have a normal, let's say it is 0,0,1. Okay, let's just swap the y and z axes, and now you have your world normal, 0,1,0. You can add in another high-frequency normal map lookup to get some more detail if you want. Then take your directional light direction in world space. You can calculate this and upload the vec3 to the shader each frame. The world space vector of the light direction would equal TFormVector(Vec3(0,0,1),light,Null). Now take the dot product of the light direction in world space and the water surface normal in world space, and that tells you how "lit" the pixel is. This can be used with a specular equation to calculate specular reflection. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Gandi Posted January 19, 2010 Author Share Posted January 19, 2010 ok.. ill try to explain it better ^^ I have the heightmap (i know i could make a normalmap out of it, but the calculation kinda worked nicer) now i have the normals of the waves.. if i now just add the detail normals the result doesnt look very nice, so i want to kinda adjust the detail normals to the waves. you can think of that like a blanket. you take the blanket and lay it above some rough underground. you will see, the blanket will fit the undeground and wont lie down flat. thats exactly what i want to do with my detail normals. lets say i got this raw undergrund by sampling the heightmap. now i want to take the detail normals and just put them above the waves.. then i dont have a "flat" normalmap anymore but the normals will fit the waves.. if i just add the detail normals they will always point into the same direction.. i hope you understand now what i want to do (if not i think a picture is my last chance of eyplaning it ^^) €: Ok.. i made an image right away ^^ Red: The normal from the heightmap. Green: The normal from the detail map. Grey: is just a helper to see what ive donw in the top half of the picture you see the way (i think) that you explained.. in the bottom half you see it the way i mean it. as you can see the detail normal aligns to the wave normal.. the gray line should now pe normal to the wave-normal Quote Link to comment Share on other sites More sharing options...
Marleys Ghost Posted January 20, 2010 Share Posted January 20, 2010 Well so far it looks great Gandi, very nice work Quote AMD Bulldozer FX-4 Quad Core 4100 Black Edition 2 x 4GB DDR3 1333Mhz Memory Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5 Windows 7 Home 64 bit BlitzMax 1.50 • Lua 5.1 • MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro 3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET LE 2.5/3.4 • Skyline • UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0 Marleys Ghost's YouTube Channel • Marleys Ghost's Blog "I used to be alive like you .... then I took an arrow to the head" Link to comment Share on other sites More sharing options...
Josh Posted January 20, 2010 Share Posted January 20, 2010 That problem is pretty much identical to regular old bumpmapping. You will need the binormal/tangent, somehow. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.