Guest Red Ocktober Posted February 28, 2010 Share Posted February 28, 2010 i dunno what's happening here today, but it seems as if i'm having a coding epiphany ... or something... anyways... i finally got some water with real waves (on the cpu using a simple sin function) with josh's water shader... it's not all that pretty, but at least i can see some waves... check out the short video below (open the zip and play) still got a bit to do to make it acceptable for government work... i'm using a mesh with 2178 vertices and still getting around 70 frames per sec in an 8x6 window... --Mike Quote Link to comment Share on other sites More sharing options...
Marleys Ghost Posted February 28, 2010 Share Posted February 28, 2010 8x6 window [~] <---- hmm its a little small ... 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...
ESP Posted February 28, 2010 Share Posted February 28, 2010 Nice Robin Quote Programmer , Intel Quad core, NVIDIA GeForce GT 220, Windows 7 Pro, Galaxy Tab 2 ( 7" and 10"), LE2,LE3,3DWS Link to comment Share on other sites More sharing options...
carlb Posted February 28, 2010 Share Posted February 28, 2010 i hope you release some code to us that been waiting for something like this and it looking good Quote Asus ROG STRIX B350-F GAMMING AMD Ryzen 7 1700x 32 gb ddr4 15 TB raid 5 HD Nvidia EVGA 1060GTX Win10 64bit Link to comment Share on other sites More sharing options...
VicToMeyeZR Posted February 28, 2010 Share Posted February 28, 2010 How did that train get up there? Dag'um Quote AMD Phenom II x6 1100T - 16GB RAM - ATI 5870 HD - OCZ Vertex 2 60GB SSD Link to comment Share on other sites More sharing options...
Guest Red Ocktober Posted February 28, 2010 Share Posted February 28, 2010 [~] <---- hmm its a little small ... the better to keep the framerate up my dear How did that train get up there? Dag'um yeah.... who left that thing up there... i hope you release some code to us that been waiting for something like this sure... it's nothing spectacular... right now the code is in all over the place... but it's not difficult at all to follow... actually, it's quite simple... in Renderer.bmx i load my own mesh instead of using the mesh that is originally created... search for waterpatch and this segment of code (the commented stuff is the original code)... 'Create water mesh and prepare If Not waterpatch SetWorld transparency.world ' waterpatch=CreatePatch(20,20) waterpatch=LoadMesh("abstract::OceanLakePond.gmf") EntityOcclusionMode(waterpatch,True) SetWorld Main.world EndIf then a few lines under that i messed around with the scale and the position... waterpatch.paint(watermaterial[submerged]) ' waterpatch.SetScale(vec3(Main.camera.farrange*3.0)) waterpatch.SetScale(vec3(.5,.25,.5)) ' waterpatch.SetPositionf(Main.camera.mat.tx,waterheight,Main.camera.mat.tz,1) waterpatch.SetPositionf(0,waterheight,120,1) the actual function to animate the water is in the calling program... in the main loop slip in... If fw.renderer.waterpatch Then AnimateWaves(fw.renderer.waterPatch) ( the leadwerks water is referenced fw.render.waterPatch ) then add this function... Function AnimateWaveMesh(theWater:TMesh) Local vertex:TVec3[2180] Local theWaves:TSurface Local lwWaves:TSurface Local waveFreq:Float theWaves=GetSurface(theWater,1) For Local i:Int =0 To 2177 Local waveFreq:Float=MilliSecs()/16 vertex[i]=GetVertexPosition(theWaves,i) vertex[i].y=Sin( waveFreq+vertex[i].x*50 + vertex[i].z*30)*5 SetVertexPosition (theWaves,i,vertex[i]) Next EndFunction as you can see i've got a lot of stuff hard coded... and i'm sure there's a better way to organize everything... this was just the results of a sudden hot flash i had today... don't know where it came from... i'll be looking into putting back the original large ocean plane and doing a lot of other fixesa lil later... just glad to have found a way to implement this after so long... dunno why it took me soooo long... i was looking for something a lil more complicated... oh yeah... the mesh im using for the water (something i had lying around from way back in the original 3DRAD days, so you might wanna make a better one) converted over to gmf... get it below and put it in your path... rename the extension to .gmf... --Mike OceanLakePond.zip Quote Link to comment Share on other sites More sharing options...
Pixel Perfect Posted February 28, 2010 Share Posted February 28, 2010 That's looking pretty good Red ... well done! 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...
Naughty Alien Posted March 1, 2010 Share Posted March 1, 2010 ..hmm..strange, when i load custom mesh as a water surface, it is loaded but just blank white?? Anything special you did with water mesh before actual load in to program Red ?? I havent add waves, just loaded mesh as a waterpatch.. Quote Link to comment Share on other sites More sharing options...
Marleys Ghost Posted March 1, 2010 Share Posted March 1, 2010 is the mesh at the origin and you are not? it covers only a small area, you maybe looking at the underwater divide 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...
diedir Posted March 1, 2010 Share Posted March 1, 2010 hey Red ! fine to see your sub in the great pond !! good job Quote AMD Ryzen 5900HX - Nvidia RTX 3070 - 32 Go - 1To SSD - W11 Link to comment Share on other sites More sharing options...
Naughty Alien Posted March 1, 2010 Share Posted March 1, 2010 what you mean at origin? Mesh covering exact area i need to cover and i did exactly what he did(according to code i saw), but waterpatch surface(custom one) is white and i see it..its just..no reflection and stuff I got with usual one(createpatch)..just wondering what can go wrong or is there any other way to treat mesh waterpatch.. Quote Link to comment Share on other sites More sharing options...
Marleys Ghost Posted March 1, 2010 Share Posted March 1, 2010 Just started playing with it myself, but when I first tried I was in the wrong place, there was a white area that marked the divide for submerged but no water mesh .. I did a new scene and put myself at the centre and there it was just wondered if that was your issue? .. only been playing with it for half an hour was just thinking out loud. 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...
Guest Red Ocktober Posted March 1, 2010 Share Posted March 1, 2010 hey there diedir... how ya doin yeah... i finally got a lot of legal stuff done and i had a few days to actually pay attention to what i'm doing... now i gotta spend some time learning how to texture the sub and interior... always something... NaughtyA asks: ..hmm..strange, when i load custom mesh as a water surface, it is loaded but just blank white?? Anything special you did with water mesh before actual load in to program Red ?? I havent add waves, just loaded mesh as a waterpatch.. nothing special... i just replaced the default mesh josh creates in Renderer.bmx with the plain untextured mesh... the code in Renderer.bmx should apply the shader to it... the scene you load should have a waterplane in it... you can try using Marley's simple scene loading code ( http:// http://leadwerks.com/werkspace/index.php?/topic/670-a-simple-scene-loader-in-blitzmax/ ) to load a scene with some water and terrain (try to make sure the errain and the player start are near the center of your map, else mod the code in Renderer.bmx to place the waterPatch at the desired location like Marley alluded to)... or... you can edit this line in Renderer.bmx, and the water should appear anywhere the camera is located in the scene... 'waterpatch.SetPositionf(Main.camera.mat.tx,waterheight-1,Main.camera.mat.tz,1) waterpatch.SetPositionf(EntityPosition(Main.camera).x,waterheight-1,EntityPosition(Main.camera).z,1) i still have to do a bit of work with this before it is ready for prime time... for instance, i still need to whip up some code to implement my 3 x 3 treadmill system here so that the water will appear infinite from the viewer (can anyone point me to cloning code or logic for LW)... plus some method of making this universally usable without invalidating the original stuff... also... Josh... could you add some foam to the textures like there was in the earlier versions... --Mike Quote Link to comment Share on other sites More sharing options...
Naughty Alien Posted March 1, 2010 Share Posted March 1, 2010 ..still white..super weird...i did try this before but i had same result..white..but i had other things to do so i never tested again until now, when i saw that Red changed it and its working..however..in my case still doesnt work..everything is at proper position, it just, water plane is white..hmm.. Quote Link to comment Share on other sites More sharing options...
Guest Red Ocktober Posted March 1, 2010 Share Posted March 1, 2010 could copy and post the segment of your renderer.bmx code where you made the changes... --Mike Quote Link to comment Share on other sites More sharing options...
Naughty Alien Posted March 1, 2010 Share Posted March 1, 2010 ..sure..here it is.. 'Create water mesh and prepare If Not waterpatch SetWorld transparency.world 'waterpatch = CreatePatch(20, 20) waterpatch = LoadMesh("abstract::patch.gmf") EntityOcclusionMode(waterpatch, True) SetWorld Main.world EndIf waterpatch.SetColor(watercolor) waterpatch.paint(watermaterial[submerged]) 'waterpatch.SetPositionf(Main.camera.mat.tx,waterheight,Main.camera.mat.tz,1) waterpatch.SetPositionf(1, waterheight, 1, 1) and of course, after every changes, I did compile module to make changes work..but so far nothing..here is the patch example i use..so give it a go..im really wondering is it something maybe wrong with my gmf. waterpatch mesh:--> http://www.mediafire.com/?o1mgzkkrwbc Quote Link to comment Share on other sites More sharing options...
Guest Red Ocktober Posted March 1, 2010 Share Posted March 1, 2010 code looks ok... ( i never did module recompile, don't think u need to) hhhhhmmmmm... i dunno NA... are you running 2.3 or 2.31... (shouldn't make a difference though)... looking at your mesh now... --Mike Quote Link to comment Share on other sites More sharing options...
Naughty Alien Posted March 1, 2010 Share Posted March 1, 2010 ..well..i have tested 2.3 and 2.31..same issue...weird.. Quote Link to comment Share on other sites More sharing options...
Guest Red Ocktober Posted March 1, 2010 Share Posted March 1, 2010 Naughty, try using my mesh (get it above)... download it, change the extension from zip to gmf... put it in your path... reference it in loadmesh... i substituted your mesh to test, and i started getting unusual errors from the default renderer code... --Mike Quote Link to comment Share on other sites More sharing options...
Naughty Alien Posted March 1, 2010 Share Posted March 1, 2010 ..allright...ill try now your waterplane..im wondering what will happen.. EDIT: I cant open archive...Winrar giving me error that its damaged and cant be extracted..sigh.. Quote Link to comment Share on other sites More sharing options...
Guest Red Ocktober Posted March 1, 2010 Share Posted March 1, 2010 it'll work... --Mike Quote Link to comment Share on other sites More sharing options...
Naughty Alien Posted March 1, 2010 Share Posted March 1, 2010 hey Red..can you post new download link with your waterpatch mesh only? Previous one, giving me an error in archive...I cant open it. Quote Link to comment Share on other sites More sharing options...
Marleys Ghost Posted March 1, 2010 Share Posted March 1, 2010 just rename the .zip to .gmf its a gmf file not a zip archive. 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...
Naughty Alien Posted March 1, 2010 Share Posted March 1, 2010 ..yup..as I thought...my water plane is not good..but, im really wondering what can be exported wrong on one flat surface? hmm Quote Link to comment Share on other sites More sharing options...
Guest Red Ocktober Posted March 1, 2010 Share Posted March 1, 2010 you got it working? --Mike Quote 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.