Madjack Posted February 23, 2012 Share Posted February 23, 2012 Downloaded the evaluation kit last night and am spending the day checking it out. Have a question however. I'm interested in being able to set glowmaps in order to achieve a 'Tron' like appearance on my models. (In Blitz I could achieve this by adding a second additive texture layer to a surface.) I understand LE uses a somewhat different system with materials/shaders. To test this, I've set up a simple cube with a single material that has a diffuse map in texture0 and a glowmap at texture1. The shaders used are: Shader: Vertex:mesh_diffuse_vert Pixel:mesh_diffuse_glow.frag Shadow Shader vertex:mesh_shadow.vert Pixel:none This appears to give me the effect I want going by the preview showing in the materials editor. The model also displays the additive glowmap texture correctly when added to a scene in the editor. However the model viewer doesn't show the glowmap layer. Additionally, my BMax code (adapted from the code generated by the projectbuilder.exe), doesn't show the glowmap on the cube either.. I note the oildrum model does appear ok with specular/bumpmapping. I've ensured there is only one gmf file and one set of dds textures that the abstract path can find. The debuglog indicates LE is finding the relevant textures/material file. Any ideas? Nvidia GTX560, Win7 - latest Nvidia drivers. BlitzMax Quote Link to comment Share on other sites More sharing options...
Naughty Alien Posted February 23, 2012 Share Posted February 23, 2012 ..hey MadJack..all you need to do is to have your glow texture exposed to glow shader. Material file name should be same as name of glow texture, without extension, like My_Glow_Texture.Mat and content of that material file will be: texture0="abstract::My_Glow_Texture.dds" texture2="abstract::My_Glow_Texture.dds" castshadows=1 collisiontype=0 cullface=0 color=0.3,0.3,0.3,1.0 // color of your glow shader="abstract::mesh_diffuse.vert","abstract::mesh_diffuse_glow.frag" shadowshader="Abstract::mesh_shadow.vert","" So if your cube has on its surface texture My_Glow_Texture.dds, it should work by default. Quote Link to comment Share on other sites More sharing options...
Madjack Posted February 23, 2012 Author Share Posted February 23, 2012 NA Thanks for the hints. I'm not sure that what you've suggested is exactly what I'm after though. My terminology probably isn't clear. I essentially want to recreate the effect of having an additive texture on the second or third texture layer. I would have thought that setting texture01 to the additive texture and then using mesh_diffuse_glow.frag would do the trick. When I do this, the material preview seems correct and the editor shows the additive texture coming through the diffuse texture just fine. However I'm only seeing the diffuse texture in the model viewer and my BMax code also shows a cube with just the diffuse texture. I don't understand why I'm seeing different results between the material editor + editor vs model viewer + code. I've probably missed something I guess. I'm using the following to view the cube. Framework leadwerks.ENGINE RegisterAbstractPath("C:/Leadwerks Engine SDK") GCSetMode(2) Graphics 800, 600 WORLD = CreateWorld() ;If Not WORLD RuntimeError "Failed to create world." gbuffer = CreateBuffer(GraphicsWidth(), GraphicsHeight(), BUFFER_DEPTH | BUFFER_COLOR0 | BUFFER_COLOR1 | BUFFER_COLOR2) light = CreateDirectionalLight() RotateEntity light,[45.0,45.0,45.0] cam = CreateCamera() MoveEntity cam, Vec3(0, 0, -31) 'Create a visual mesh OB = LoadMesh("abstract::box_1.gmf") While Not KeyHit(KEY_ESCAPE) UpdateAppTime() TurnEntity OB, Vec3(.1, .1, .1) SetBuffer(gbuffer) RenderWorld() SetBuffer(BackBuffer()) RenderLights(gbuffer) Flip(1) Wend Quote Link to comment Share on other sites More sharing options...
Madjack Posted March 17, 2012 Author Share Posted March 17, 2012 Really need some help regards this issue (thanks NA for your valiant attempt) To reiterate, simply want a diffuse texture on level 0 and an additive texture on level 1. What am I missing??? I can set up a material that uses mesh_diffuse_glow.frag for the pixel shader and I have a diffuse texture on texture 0, and my additive texture on texture 1. The material editor then correctly shows the additive texture blending with the texture layer. Additionally, if I load the mesh into an editor scene, it appears correctly in the scene with the additive texture blended with the diffuse texture. However if I load the mesh into model viewer, it only shows the diffuse texture. Also, if I load the mesh into my BMax prog, it only shows the diffuse texture. Why? Why is there a difference between what I see in the editor and the model viewer??? What's going on??? <edit> Macklebee has just kindly helped me out on this issue. Simple matter of making sure buffer creation included BUFFER_COLOR3, as that is the buffer the glow shader outputs to. Got to say, as a newbie, this was not at all clear to me. gbuffer = CreateBuffer(GraphicsWidth(), GraphicsHeight(), BUFFER_DEPTH | BUFFER_COLOR0 | BUFFER_COLOR1 | BUFFER_COLOR2 | BUFFER_COLOR3) It seems my error was using code from the wiki which apparently is well out of date in that I copied code from the wiki BMX PDF examples. Had no idea that I was missing a buffer call. Bumpmapping/specular seemed to work as expected. Quote Link to comment Share on other sites More sharing options...
Naughty Alien Posted March 17, 2012 Share Posted March 17, 2012 ..Mad Jack, can you post some screen of object of your interest, as an example, in order to clearly see, what effect you wanna to achieve? Quote Link to comment Share on other sites More sharing options...
Madjack Posted March 17, 2012 Author Share Posted March 17, 2012 NA Basically this - where an additive texture blends with the base diffuse texture in order to give the glowing edge Tron style. Turns out it was because my buffer creation didn't include BUFFER_COLOR3 in the declaration 1 Quote Link to comment Share on other sites More sharing options...
Reaper2 Posted March 23, 2012 Share Posted March 23, 2012 Not sure if this area is open to any newbie questions or not but when I try to create the tutorial project it keeps popping up with, "Unable to start program C:Usersusertdocumentsvisual studio 2010ProjectsSpincube3Spincube3../Spincube3.exe The system cannot find the file specified. I don't know if this is becuese I am using the VS 2010 version or if it is something as stupid as I am not specifying the right area somewhare to find the file. Any help would be greatly appriciated. Quote "You know what the differance between you and me really is? You look out there and see a horde of evil, brain-eating zombies. I look out there and see a target-rich environment." Dillis D. Freeman, jr. Link to comment Share on other sites More sharing options...
gamecreator Posted March 23, 2012 Share Posted March 23, 2012 Reaper2, it's better to start your own thread if it's off-topic to the original. I would suggest downloading and using free Express 2008, from here: http://www.leadwerks.com/werkspace/files/file/215-visual-c-2008-express-edition/ Quote Link to comment Share on other sites More sharing options...
Pixel Perfect Posted March 23, 2012 Share Posted March 23, 2012 Are you using a project created using the LEBuilder Tool ? This should ensure everything is set up correctly in your project prior to attempting to compile, link and execute. 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...
Reaper2 Posted March 23, 2012 Share Posted March 23, 2012 I was trying to use the manually create tutorial, the LEbuilder one worked fine though. Maybe I will just have to try the VS 2008 version and see if it works better. Thanks a ton for the advice and I will remember the thread thing for next time. Ultimately it is probably some small detail somewhare I am missing. Again thanks everyone. Quote "You know what the differance between you and me really is? You look out there and see a horde of evil, brain-eating zombies. I look out there and see a target-rich environment." Dillis D. Freeman, jr. Link to comment Share on other sites More sharing options...
Pixel Perfect Posted March 23, 2012 Share Posted March 23, 2012 If the LE Builder one worked fine with 2010 I would stick with that and just wipe the example code and start with your own tutorial one. At least then you know you are starting with a good project configuration. I don't know what tutorial you are using but beware, not all the tutorials have been kept up to date. I've lost track of what works and what doesn't! 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...
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.