Rick Posted January 7, 2010 Share Posted January 7, 2010 Is there a water texture and shader that comes with LE? If so where would the texture be and how do you use the shader? Quote Link to comment Share on other sites More sharing options...
Paul Thomas Posted January 7, 2010 Share Posted January 7, 2010 mesh/water.frag, (postfilters/caustics.frag,) materials/water Quote Link to comment Share on other sites More sharing options...
Rick Posted January 7, 2010 Author Share Posted January 7, 2010 So in materials/water I see a water.mat and it has: texture0="abstract::water01DOT3.dds" texture1="abstract::wobbleDOT3.dds" texture7="abstract::caustics.dds" castshadows=0 shader="abstract::mesh_diffuse.vert","abstract::water.frag" //depthmask=0 But I don't see any of those dds files. Quote Link to comment Share on other sites More sharing options...
Paul Thomas Posted January 7, 2010 Share Posted January 7, 2010 It's done in Renderer: local watertime:float = (apptime() / 200.0 * wavespeed) local waterframe:int local framename:string waterframe = watertime Mod 32 framename = waterframe if waterframe < 10 framename = "0" + framename if not watertexture[waterframe] watertexture[waterframe] = loadtexture("abstract::water02_" + framename + ".dds") endif ' ............. setmaterialtexture(watermaterial[submerged], watertexture[waterframe], 6) setmaterialtexture(watermaterial[submerged], watertexture[Modulate(waterframe-1,32)], 0) ' ............. function Modulate:float(a:float, b:float) a = a Mod b if a < 0 a = b + a return a endfunction The rest can be found in Renderer in the Draw method/function. Quote Link to comment Share on other sites More sharing options...
Rick Posted January 7, 2010 Author Share Posted January 7, 2010 Ah, interesting! I'll take a look at this. Thanks! Quote Link to comment Share on other sites More sharing options...
Paul Thomas Posted January 7, 2010 Share Posted January 7, 2010 Np man Quote Link to comment Share on other sites More sharing options...
Rick Posted January 7, 2010 Author Share Posted January 7, 2010 How does the water get the transparency to it? When I just use one of the water dds files there is no transparency. Quote Link to comment Share on other sites More sharing options...
Paul Thomas Posted January 7, 2010 Share Posted January 7, 2010 I believe this line would do it: if not waterpatch setworld(transparency.world) waterpatch = createpatch(20, 20) entityocclusionmode(waterpatch, true) setworld(Main.world) endif Quote Link to comment Share on other sites More sharing options...
Rick Posted January 7, 2010 Author Share Posted January 7, 2010 hmm, I thought you could create a texture to be semi-transparent without having to go into the transparency world. Currently, just trying to get something simple here with a semi-transparent texture of standing water. Quote Link to comment Share on other sites More sharing options...
Paul Thomas Posted January 7, 2010 Share Posted January 7, 2010 For this I'm not sure, but you would just have to go into the transparency world just to create the mesh/plane. Quote Link to comment Share on other sites More sharing options...
Rick Posted January 7, 2010 Author Share Posted January 7, 2010 Hmm, I did: SetWorld(world_transparency) object.plane = CreatePlane() object.mat = LoadMaterial("Models/Entities/Pi/Pi-Water/water4.mat") object.plane:Paint(object.mat) SetWorld(world_main) But got the same result. If I open the dds in Paint.NET and change transparency to 125 or below then it doesn't show up at all. Quote Link to comment Share on other sites More sharing options...
Paul Thomas Posted January 7, 2010 Share Posted January 7, 2010 Hmm. Would it matter if it was painted in the transparency world instead of in the main world? I think I need to stop working on my editor and try this myself to help you out better. Quote Link to comment Share on other sites More sharing options...
Rick Posted January 7, 2010 Author Share Posted January 7, 2010 Didn't seem to matter. I put the paint both inside transparency and main worlds and same result. Quote Link to comment Share on other sites More sharing options...
Niosop Posted January 7, 2010 Share Posted January 7, 2010 The fact that it disappears with an alpha below 125 makes me think that it's using an alpha mask shader instead of an alpha blend. Quote Windows 7 x64 - Q6700 @ 2.66GHz - 4GB RAM - 8800 GTX ZBrush - Blender Link to comment Share on other sites More sharing options...
Rick Posted January 7, 2010 Author Share Posted January 7, 2010 So have you guys ever tried any trasparent texture on a model in the editor? If so how, what did you do to get it to work? Quote Link to comment Share on other sites More sharing options...
Pixel Perfect Posted January 7, 2010 Share Posted January 7, 2010 I have a transparent texture working on a model in the Editor but again its just using the alpha test shader to allow complete transparency over the face area of a hair mesh . That's simply using the mesh_diffuse_alphatest.frag shader defined in the material file and it works fine. I just tried substituting it for the mesh_diffuse_alphablend.frag shader but that doesn't work, the transparent area shows up as opaque black! 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...
TylerH Posted January 7, 2010 Share Posted January 7, 2010 For the windows that are transparent in the shots from Jeklynn Heights I just used a blend=1 in the material: texture0="abstract::barborshop_windows_d.dds" clamp0=0,0,0 texture1="abstract::barborshop_windows_n.dds" clamp1=0,0,0 texture2="abstract::barborshop_windows_s.dds" clamp2=0,0,0 texture3="abstract::barborshop_windows_selfillum.dds" clamp3=0,0,0 blend=1 depthmask=1 depthtest=1 overlay=0 zsort=1 cullface=0 castshadows=1 specular=2.50000000 bumpscale=1.00000000 gloss=0.100000001 bakeaomap=1 raytraced=1 shader="abstract::mesh_diffuse_bumpmap.vert","abstract::mesh_diffuse_bumpmap_specularmap_glow.frag" shadowshader="abstract::refraction.vert","" Ignore bakeaomap and raytraced and the selfillum stuff, that is all some custom shader work we did that isn't related to the transparency. Quote nVidia 530M Intel Core i7 - 2.3Ghz 8GB DDR3 RAM Windows 7 Ultimate (64x)----- Visual Studio 2010 Ultimate Google Chrome Creative Suite 5 FL Studio 10 Office 15 ----- Expert Professional Expert BMX Programmer ----- Link to comment Share on other sites More sharing options...
Rick Posted January 8, 2010 Author Share Posted January 8, 2010 Do you have an example texture of the windows that I can test with? Maybe I'm screwing my textures out. Quote Link to comment Share on other sites More sharing options...
Rick Posted January 8, 2010 Author Share Posted January 8, 2010 Actually I think I got it. I used the material editor, which didn't display it very well, and it looks better in the editor. Now I have to see if I can apply the sway shader to get it to move. Hmm, I have: shader="abstract::mesh_diffuse_bumpmap_sway.vert","abstract::mesh_diffuse_bumpmap_specular_glow.frag" shadowshader="abstract::refraction.vert","abstract::ambientlight.frag" but no sway. Quote Link to comment Share on other sites More sharing options...
Rick Posted January 8, 2010 Author Share Posted January 8, 2010 Nevermind, I guess it is swaying, just very little. Is there a way to make the swaying maybe more powerful? Quote Link to comment Share on other sites More sharing options...
Paul Thomas Posted January 8, 2010 Share Posted January 8, 2010 Yeah, but unless you make a new mesh_diffuse_bumpmap_sway, it'll effect everything that uses sway. In that file it says: LW_SWAY 0.02 Just increase the number. Quote Link to comment Share on other sites More sharing options...
Rick Posted January 8, 2010 Author Share Posted January 8, 2010 Yeah, I can distribute the new shader with the object. Thanks for the tip. Quote Link to comment Share on other sites More sharing options...
Paul Thomas Posted January 8, 2010 Share Posted January 8, 2010 Np man Quote Link to comment Share on other sites More sharing options...
TylerH Posted January 8, 2010 Share Posted January 8, 2010 This is pretty cool, but I have to ask, why aren't you just using the default Leadwerks water shader applied to the plane? Then you can just render all your puddles like the single infinite water plane, and there you go... EDIT: I guess because the water shader doesn't seem to work when applied to other meshes, lol. Answered my own question. Quote nVidia 530M Intel Core i7 - 2.3Ghz 8GB DDR3 RAM Windows 7 Ultimate (64x)----- Visual Studio 2010 Ultimate Google Chrome Creative Suite 5 FL Studio 10 Office 15 ----- Expert Professional Expert BMX Programmer ----- Link to comment Share on other sites More sharing options...
Rick Posted January 8, 2010 Author Share Posted January 8, 2010 lol, yeah, I couldn't get it to work. About the puddles being a single infinite water plane, the problem with the infinite water plane is the height of things. If my castle is high on a mountain I can't have an infinite plane for the water. I need a plane that I can control the size of. This would also work for things like swimming pools or like a wishing well. Anything that needs water that can't be done with the 1 single infinite plane. I might actually have to change this to a cube though because currently no matter what if the camera x & z are in the bounds of the plane and the camera y is < the water plane y it'll do the underwater effect to the screen. This limits having tunnels under the water plane because even though visually you aren't in water, if your tunnel goes under the water plane it would apply the underwater effect. With a cube I could limit the water on all sides. This cube could just be a body I guess. 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.