Frictional Games Forum (read-only)
Lighting & Custom Content - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: SOMA (https://www.frictionalgames.com/forum/forum-55.html)
+--- Forum: User created content (https://www.frictionalgames.com/forum/forum-79.html)
+---- Forum: Technical Support (https://www.frictionalgames.com/forum/forum-80.html)
+---- Thread: Lighting & Custom Content (/thread-30803.html)



Lighting & Custom Content - Tesseract - 09-24-2015

Greetings all!

I've been running into a rather annoying issue - at least I think it's an issue. I've added a floor texture that I have made, it has the usual normal, specular and diffuse maps, when I put it into the level editor and place a point light above the texture one half of the light illuminates the primitive and the other half is in darkness.

I have two lights here but they're both doing the same thing.

Here is a reference image:
[Image: ULjlHBx.png]

Now either there is something wrong with my texture, there's something buggy going on in the engine or there are more specialized settings for the pointlight, though the last suspicion is the most unlikely, as the game textures don't seem to encounter this problem. I have a strong inkling that it might have something to do with my normal map or something.

If anyone has any suggestions or input, that would be great!




RE: Lighting & Custom Content - Aaron - 09-25-2015

Make sure you apply a normal map to your material, I have provided a small blank normal map in textures>technical I believe called blank.nrm. This should fix the problem.


RE: Lighting & Custom Content - Tesseract - 09-25-2015

(09-25-2015, 09:14 AM)Aaron Wrote: Make sure you apply a normal map to your material, I have provided a small blank normal map in textures>technical I believe called blank.nrm. This should fix the problem.

Thank you for getting back to me, Aaron!

My texture does have a normal map applied along with a specular one too. Though when I apply your blank.nrm lighting does behave correctly over the primitive. Though because your blank.nrm has no texture, my texture appears shiny and flat.

Would you say there is something wrong with my normals? It's a .dds file that I created with a free program called SSbump: [Image: 3FSF1Jp.png]


RE: Lighting & Custom Content - jens - 09-25-2015

Try inverting it! I think HPL2 and HPL3 have changed when it comes to normal maps so you have to change your workflow.


RE: Lighting & Custom Content - jens - 09-25-2015

Or from wiki
The normal map for the material and uses the standard format rgb = xyz and is in tangent space. Note that this needs to be converted to a format of XY only though (3dc)!

Not an artist so what it means? no clue Smile


RE: Lighting & Custom Content - Tesseract - 09-25-2015

(09-25-2015, 12:14 PM)jens Wrote: Try inverting it! I think HPL2 and HPL3 have changed when it comes to normal maps so you have to change your workflow.

(09-25-2015, 12:16 PM)jens Wrote: Or from wiki
The normal map for the material and uses the standard format rgb = xyz and is in tangent space. Note that this needs to be converted to a format of XY only though (3dc)!

Not an artist so what it means? no clue Smile

Hello Jens!

I just tried a few things, inverting it didn't provide any change unfortunately. Though, the quote from the wiki - that I did happen to find some days ago - doesn't make much sense to me either. Assuming R = x, G = y and B = z I might have to play around with the RGB channels in Photoshop so that I end up with XY or RG channels.

Thank you for your help thus far!

Edit:
Unfortunately the problem still exists despite removing the blue channel.


RE: Lighting & Custom Content - Aaron - 09-25-2015

Yeah make sure it is saved through 3dc, we use the nvidia dds plugin for Photoshop for this. It is a setting where you choose which compression you want to use. Right now your normal map is sRGB so it's not correct!


RE: Lighting & Custom Content - TheGreatCthulhu - 09-25-2015

(09-25-2015, 12:16 PM)jens Wrote: Or from wiki
The normal map for the material and uses the standard format rgb = xyz and is in tangent space. Note that this needs to be converted to a format of XY only though (3dc)!

Not an artist so what it means? no clue Smile

I think it means that the game uses compressed normal maps.
Since normal vectors are all unit length, and taken to be in tangent space, you can throw out one component (z).

I think it needs to be compressed/exported in 3Dc format, also known as BC5.
For example, NVIDIA texture tools include a command line tool that does this, using:
nvcompress -bc5 inputFileName outputFileName

Can be found here: https://developer.nvidia.com/gpu-accelerated-texture-compression

There could be some GUI tools out there as well.


RE: Lighting & Custom Content - Patrik - 09-25-2015

Also, the green channel probably has to be inverted before conversion to 3Dc for HPL2 normal maps to work properly.


RE: Lighting & Custom Content - Tesseract - 09-25-2015

(09-25-2015, 12:44 PM)Aaron Wrote: Yeah make sure it is saved through 3dc, we use the nvidia dds plugin for Photoshop for this. It is a setting where you choose which compression you want to use. Right now your normal map is sRGB so it's not correct!

Aaron, that has seem to have solved the problem! I'm so pleased I could explode! I'll have to buy you a drink one day, or perhaps marry you. Though for now thank you for your time, much appreciated!