3D Rad - Free 3D game maker - Forum

This forum is now archived!

This forum is locked, and is a read-only version. A new community-ran forum can be found at classdev.net

News:

The 3DRad community can be found at classdev.net.

Pages: [1] 2

Author Topic: Issues with lightmap shader  (Read 413 times)

« on: March 27, 2014, 01:10:04 AM »
Hey guys, I've been trying to use the lightmap shader from the system shaders addon, but I am having some isssues.

No matter what I try (creating the lightmap in different programs, using different depth sorting/z-buffer settings etc...) it always comes out looking like this:



I have followed the tutorial floating around here somewhere, set the shader to lightmap, the mode to Shaddow-map and used a script to set the emmissive factor

Any thoughts?

Thanks,

George.
« Last Edit: March 27, 2014, 01:12:13 AM by georgio123 »
« Reply #1 on: March 27, 2014, 03:34:53 AM »
If you use L3DT there is an option to generate lightmap.

If you want to make it alone make grayscale texture.

Can you show your texture and lightmap and tell what 3d engine you use? This can be helpful for us to understand the error.
If we don't give up we can achieve the unthinkable!
« Reply #2 on: March 27, 2014, 06:34:44 AM »
1- how many meshes are we looking at in the pic... one or two...

2- what program are you using to create the lightmap...

--Mike
« Reply #3 on: March 27, 2014, 03:03:56 PM »
The lightmap in this image was created with L3DT, however, I have the exact same issue with lightmaps created in Giles.

I either get a completely black mesh, or this weird flashing thing occurs (like in the image in the original post).

Mike, the lightmap is one mesh, the island is another.

I've included the Terrain skinmesh and lightmap skinmesh, as well as the lightmap jpeg in this post for people to take a look at if they wish.

Thanks for your help guys
« Reply #4 on: March 27, 2014, 03:52:37 PM »
to me it has not given me problems  ???
my strength is the texturing and graphics
« Reply #5 on: March 27, 2014, 06:02:48 PM »
Joseuz, would you be able to tell me what you did? what shader settings you used on each mesh etc....

Did you use the lightmap shader on one of the meshes?

Thanks,

G
« Reply #6 on: March 27, 2014, 07:31:38 PM »
I used lightmap shader on the skinmesh with the lightmap image. Maybe Joseuz used another method but you can try it, i saw it on the shadmar's tutorial. If it doesn't work, take a look there.
See my web:
« Reply #7 on: March 27, 2014, 08:40:07 PM »
everything is in island.3dr  ;D

first sets the island is green (A) and put it into 0009_emissive also active (Depth sorting)

then put the island blue with green and red (B) put in (0030_user_lightmap) and (shadow-map)

I hope you help
my strength is the texturing and graphics
« Reply #8 on: March 27, 2014, 08:50:14 PM »
ok... this is common if you didn't use the .x mesh which is output by the lightmapper...

for example... giles gives me two meshes... use those two meshes, not your original
(which you may want to keep as another name, just in case)

and set the depth sorting and  no zbuffer properties for the lightmap mesh as well...


one more thing... have you guys tried running your terrain mesh through Shad's TerrainShader Util...

http://www.3drad.com/forum/index.php?topic=3361.30



--Mike

« Last Edit: March 27, 2014, 09:45:49 PM by Mike Hense »
« Reply #9 on: March 27, 2014, 10:10:53 PM »
joseuz - thanks for your help, but I don't think you've fixed my problem. I had a look at the .3dr. You've used the 'emissive' shader on the lightmap mesh, and the lightmap shader on the island mesh.

Basically, it means I'm just seeing the black and white lightmap texture stretched over a mesh, rather than any use of the light map shader. The island mesh, which you've used the glossy lightmap shader on is invisible behind the emmissive mesh because you've ticked 'depth sorting' on the latter.

Mike - Are you saying I should use both of the .x meshes that Giles spits out? One for the island and the other for the lightmap?

Edit:
Quote
one more thing... have you guys tried running your terrain mesh through Shad's TerrainShader Util...
No I haven't. Do you think it may help?
« Last Edit: March 27, 2014, 10:25:36 PM by georgio123 »
« Reply #10 on: March 28, 2014, 12:15:45 AM »
Hey guys, I've been trying to use the lightmap shader from the system shaders addon, but I am having some isssues.

No matter what I try (creating the lightmap in different programs, using different depth sorting/z-buffer settings etc...) it always comes out looking like this:



I have followed the tutorial floating around here somewhere, set the shader to lightmap, the mode to Shaddow-map and used a script to set the emmissive factor

Any thoughts?

Thanks,

George.
Use user_lightmap_� shader, put your lightmap in the model's directory as "userTextureA.dds". It's recomended to convert your lightmap to .dds. Then there are no way of errors :D. I've tried it also even from L3DT.
If we don't give up we can achieve the unthinkable!
« Reply #11 on: March 28, 2014, 05:31:51 AM »
Quote
Mike - Are you saying I should use both of the .x meshes that Giles spits out? One for the island and the other for the lightmap?
yes... exactly...

Quote
Use user_lightmap_� shader, put your lightmap in the model's directory as "userTextureA.dds".
that will work if you have a single texture and select the Lightmap By Existing UV lighting method...

--Mike



« Reply #12 on: March 28, 2014, 09:36:41 PM »
Mike, I've tried creating a lightmap with Giles and using both of the .x meshes it produces. Sadly, I still have problems with the lightmap shader. The LM mesh is still completely black. However, I've found that by using another shader (user_tile for example) I can get the lightmap to work fairly well (see attached pic).

As for the craziness shown in the first post, I can fix that by messing around with the Depth sorting settings (thanks to everyone who suggested that).

I don't know why the lightmap shader isn't working for me, but seeing as the above method works fine, it is no longer an issue.

The only problem I'm running into now is that, because the shadow maps created in both Giles and L3DT contain shading for the main mesh, the areas on the Island model not facing the sun are really dark. These areas are darkened by the sunlight shading on top of the shading already provided by the lightmap.

I've tried adjusting the emmissive value on my island mesh, but this doesn't work on the terrain shader (it only increases the intensity of the original RGB texture and makes it visible over the grass rock and sand textures)
« Reply #13 on: March 29, 2014, 01:43:14 AM »
Why you don't try to add the main model to be "000_mesh" and the other(lightmap) in the same folder to be "000_tmix"? I do not know what exactly can do the "_tmix" model but you can try. Because in the 3d rad's help it's written that this file is texture mixing file. Maybe it can help... :D
If we don't give up we can achieve the unthinkable!
« Reply #14 on: March 29, 2014, 06:40:42 AM »
G... if u can send me the mesh and the texture i'll take a look at it...
(i'll keep your mesh under wraps for you)...

check your messages...

in the meantime... some lightmapping basics:

most of this you probably already know, but i'll mention it just in case...


there are two methods to lightmap a scene... the dual mesh method and the shader method...
 each has it's minuses and pluses...
 dual mesh method requires 2 meshes and if they are not identical, you may get artifacting...
 the single mesh method requires a single uvmap for the mesh... no tiling...

dual mesh method
  the base .x mesh can use either 000_deafault, 0003_bumpy, 004_bumpy_glossy, or 0014_user_bumpy or
  0015_user_bumpy_glossy shader property and the default mode set...
   use the .x mesh that comes from your lightmapping program... rename it to 000_mesh..
   Ignore Point Lights and No Shadows, No Fog, and Ignore Point Lights properties should be set...
  (allowing point lights for the base .x mesh can be allowed in some scenes in order to highlight a "lit" area)

  the lightmap .x mesh should use the 000_default  shader with the mode set to Shadow-map...
  set the Depth Sorting and No Z-Buffer properties along with No Shadows, No Dog, and Ignore Point Lights...


shadered method using 0032_user_lightmap system shader
  if your lightmapper is Giles,  use the UVMap Lighting method...
  your model should have a single uvmapped texture... tiling won't work here...
  output as normal, but you only need the lightmap bmp texture file which must be converted to renamed user_textureA.dds
  set the mesh to use 0032_user_lightmap...
 
 
below is attached 2 simple compiled examples of each method that you can walk around in and see first hand...

method1 is the dual mesh lightmapped method
method2 is the shadered lightmapped method

just download anywhere and unzip... (you will need the c++ runtimes but if you run RAD you already have em)

--Mike
« Last Edit: March 29, 2014, 12:00:51 PM by Mike Hense »
Pages: [1] 2