Jump to content

Light Issue


gamecreator
 Share

Recommended Posts

2d1tqg8.jpg

 

I have a scene (SBX) with two rock piles in it. If I move my character past the second rock, he turns dark. If I move him to either side, he turns dark. However, if I move him backwards, no matter how far back I take him, he stays light.

 

If this was all that it was, I would figure I may be doing something wrong with the lighting. However, if I remove the far rocks, the character goes dark once he moves past the close rocks instead (not going as far).

 

Here is the SBX:

 

SBX_ASCII_1.0

cameraposition=0.847888529,4.58061934,-5.69059849
camerarotation=34.1999779,3.99999523,-9.82819728e-008

Model {
path="light_directional.gmf"
position=0.000000000,1.00000000,0.000000000
rotation=45.0000000,34.9999962,3.01372808e-007
scale=1.00000000,1.00000000,1.00000000
id=39837112

"aligntoground"="0"
"castshadows"="1"
"class"="Model"
"collisiontype"="0"
"damping"="0.000000000,0.000000000"
"friction"="0.000000000,0.000000000"
"gravity"="0"
"intensity"="1.0000000000000000"
"linearoffset"="0.310000002,0.400000006,0.699999988"
"mass"="0.00000000000000000"
"name"="light_directional_1"
"order"="0"
"range"="500.00000000000000"
"resolution"="2"
"shadowdistance"="6.00000000,20.0000000,100.000000"
}


Model {
path="rocks_dark_rocky_pile.gmf"
position=0.357377023,6.21382696e-008,3.51670051
rotation=0.000000000,0.000000000,0.000000000
scale=1.00000000,1.00000000,1.00000000
id=101625272

"class"="Model"
"name"="pile_1"
}

Model {
path="rocks_dark_rocky_pile.gmf"
position=0.357377023,6.21382696e-008,13.51670051
rotation=0.000000000,0.000000000,0.000000000
scale=1.00000000,1.00000000,1.00000000
id=101625372

"class"="Model"
"name"="pile_1"
}

Terrain {
altitude=100.000000
resolution=1024
meterspertile=2.00000000
hiddentiles=0

texture0="terrain_forest_grass.dds"
bumpmap0="terrain_forest_grassdot3.dds"
texturescale0=1.00000000
texturerotation0=0.000000000
triplanarmapping0=0
layercolor0=1.00000000,1.00000000,1.00000000,1.00000000
textureblend0=1.00000000
constraints0=0.000000000,8388610.00,0.000000000,90.0000000
}

 

I also created directional lights in my code before (which created a second shadow) but even if I took that out, the same issue remained.

 

Any thoughts or suggestions?

 

 

Edit:

If I turn off SetAntialias, it results in these (while in the rocks and once past them).

 

nwes89.jpg

The character is glitchy inside the rocks but fine outside - I just realized he's glitchy inside the first set as well. Odd. Could this be a material issue? Here are the materials:

 

texture0="abstract::viking4.dds"
blend=0
depthmask=1
overlay=0
zsort=0
cullface=1
castshadows=1
specular=0.1
gloss=0.1
bumpscale=1.1
shader="abstract::mesh_skin_diffuse.vert","abstract::mesh_diffuse_bumpmap_specular.frag"
shadowshader="abstract::mesh_shadow_skin.vert"

 

texture0="abstract::helmet.dds"
blend=0
depthmask=1
overlay=0
zsort=0
cullface=1
castshadows=1
specular=0.1
gloss=0.1
bumpscale=1.1
shader="abstract::mesh_skin_diffuse.vert","abstract::mesh_diffuse_bumpmap_specular.frag"
shadowshader="abstract::mesh_shadow_skin.vert"

Link to comment
Share on other sites

Yes, your character is sucking the bumpmap and specularmap from the stones. You need either to use a diffuse only shader, or add bumpmap and specular map textures to your character.

Ryzen 9 RX 6800M ■ 16GB XF8 Windows 11 ■
Ultra ■ LE 2.53DWS 5.6  Reaper ■ C/C++ C# ■ Fortran 2008 ■ Story ■
■ Homepage: https://canardia.com ■

Link to comment
Share on other sites

A somewhat related question... When I use the exact same shader setup for a skinned character, I can only get the specular mapping to work. If I add "bumpmap" either in the pixel or vertex shader I don't get any normal mapping and if I add it to both shaders there's only a dark diffuse texture (similar to what gamecreator describes).

 

Here's my material file:

 

texture0="abstract::surcoat.dds"
texture1="abstract::surcoat_nrm.dds"
gloss=0.1
shader="abstract::mesh_skin_diffuse.vert","abstract::mesh_diffuse_bumpmap_specular.frag"
shadowshader="abstract::mesh_shadow_skin.vert",""

 

Any clues?

Link to comment
Share on other sites

@Raz. That should work ok so long as you have the specular embedded in the alpha channel of your normal map. Otherwise drop the specular on the frag shader as Metatron is suggesting above

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

Did anyone ever have an animated character working with both specular and normal mapping?

 

yes, I nearly always use Diffuse,Normal and Specular

 

http://www.leadwerks...er-test-hd-r118

 

http://www.leadwerks...ol-rig-test-r94

 

http://www.leadwerks...-more-tests-r53

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

I see. I tested my material on the standard LE hands and it does work just fine, so the model is apparently the problem here... Getting art assets into the game is just so difficult with Leadwerks...

 

Thanks for your help so far, but I really don't have a clue what could cause that sort of problem with the model. Does anybody have an idea?

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...