Custom Cockpit Shaders Not Showing

Tips, tactics, and general discussion for Evochron Legacy.
Accountant
Lieutenant
Lieutenant
Posts: 434
Joined: Wed Dec 24, 2008 2:13 am
Location: Milwaukee, WI

Custom Cockpit Shaders Not Showing

Post by Accountant »

I am trying to use the shader texture method for a new cockpit I am working on in my (nonexistent) free time. I have the following relevant files in the HUD directory:
CCPIT.x - Has 1 material with Base.png as the texture
CCPITreflect.x - Blank triangle
CCPITShader.txt - Has three lines:
Base.png
Normal.png
Specular.png
Base.png - My primary texture file
Normal.png - A normal map created with GIMP using Base.png
Specular.png - At the moment, an almost exact copy of Base.png

When I load EM, the cockpit structure loads properly, but there is no texture, no normal map, and everything is shiny (the screens should be dull, not shiny). In short, the textures aren't being recognized and used. Am I missing something? Can the textures only be a certain format, because I originally tried using BMP format and that didn't work either.

-Accountant
Enforcing GAAP in the outer systems since 2407.

Callsigns: [CPA]Accountant and Dark Helmet
Mods: EL Observation Cockpit | Dragonfly | Swallow | ER/EL Hud Mod | Sphere and Sphere Cockpit
User avatar
Vice
Administrator
Administrator
Posts: 12227
Joined: Fri Apr 25, 2003 1:38 am

Custom Cockpit Shaders Not Showing

Post by Vice »

Looks good, do you have shaders turned on in the Options menu? Did you include an alpha layer for your PNG files?
StarWraith 3D Games
www.starwraith.com | www.spacecombat.org
3D Space Flight and Combat Simulations
Accountant
Lieutenant
Lieutenant
Posts: 434
Joined: Wed Dec 24, 2008 2:13 am
Location: Milwaukee, WI

Custom Cockpit Shaders Not Showing

Post by Accountant »

Shaders are set on high. I originally did not have an alpha channel for my PNG files, but adding one didn't seem to do anything. I cannot see my texture, normal mapping, or specular mapping.

-Accountant

EDIT:
Will having the texture assigned to the model directly interfere with the shader method? i.e., the texture is applied within Metaseq and then applied again using ccpitshader.txt. Is this ok?

[Edited on 11-15-2010 by Accountant]
Enforcing GAAP in the outer systems since 2407.

Callsigns: [CPA]Accountant and Dark Helmet
Mods: EL Observation Cockpit | Dragonfly | Swallow | ER/EL Hud Mod | Sphere and Sphere Cockpit
User avatar
Vice
Administrator
Administrator
Posts: 12227
Joined: Fri Apr 25, 2003 1:38 am

Custom Cockpit Shaders Not Showing

Post by Vice »

Yes, that should be fine. If you like, I can take a look if you want to zip the files and send them to me.
StarWraith 3D Games
www.starwraith.com | www.spacecombat.org
3D Space Flight and Combat Simulations
Accountant
Lieutenant
Lieutenant
Posts: 434
Joined: Wed Dec 24, 2008 2:13 am
Location: Milwaukee, WI

Custom Cockpit Shaders Not Showing

Post by Accountant »

E-mail sent. Thanks for taking a look for me.
Enforcing GAAP in the outer systems since 2407.

Callsigns: [CPA]Accountant and Dark Helmet
Mods: EL Observation Cockpit | Dragonfly | Swallow | ER/EL Hud Mod | Sphere and Sphere Cockpit
User avatar
Vice
Administrator
Administrator
Posts: 12227
Joined: Fri Apr 25, 2003 1:38 am

Custom Cockpit Shaders Not Showing

Post by Vice »

Only problem was the model lacked normals. Once I applied those, it rendered correctly with the shader. I've e-mailed you the updated model file.
StarWraith 3D Games
www.starwraith.com | www.spacecombat.org
3D Space Flight and Combat Simulations
Accountant
Lieutenant
Lieutenant
Posts: 434
Joined: Wed Dec 24, 2008 2:13 am
Location: Milwaukee, WI

Custom Cockpit Shaders Not Showing

Post by Accountant »

I am amazed that something so simple was the problem. I thought programs like Metaseq applied normals by default.

Thanks for letting me know, I appreciate your looking at it.

-Accountant
Enforcing GAAP in the outer systems since 2407.

Callsigns: [CPA]Accountant and Dark Helmet
Mods: EL Observation Cockpit | Dragonfly | Swallow | ER/EL Hud Mod | Sphere and Sphere Cockpit
Accountant
Lieutenant
Lieutenant
Posts: 434
Joined: Wed Dec 24, 2008 2:13 am
Location: Milwaukee, WI

Custom Cockpit Shaders Not Showing

Post by Accountant »

Ok, gotta beat a dead horse here.

When I save my model as a .x file using Metaseq, EM does not see normals and as a result does not apply the textures and shaders. Yet, when I open the model using DirectX Viewer, I can see the normals just fine.

When I save my model using LithUnwrap, EM sees the normals properly, but the result is extremely faceted lighting. When LithUnwrap applies normals it doesn't seem to apply any kind of smoothing calculation. I would like to be able to use the normals that Metaseq calculates, because they are much smoother. Is there a way to do this?

Alternatively, is there a reason EM isn't seeing the Metaseq normals? Is there some difference in the file structures that would cause EM to miss the normals? Or are the normals simply not there and both Metaseq and DirectX Viewer are applying their own normals when the file is loaded?

Again, sorry for beating a dead horse, but I like to have my cake and eat it too :)

-Accountant
Enforcing GAAP in the outer systems since 2407.

Callsigns: [CPA]Accountant and Dark Helmet
Mods: EL Observation Cockpit | Dragonfly | Swallow | ER/EL Hud Mod | Sphere and Sphere Cockpit
User avatar
Vice
Administrator
Administrator
Posts: 12227
Joined: Fri Apr 25, 2003 1:38 am

Custom Cockpit Shaders Not Showing

Post by Vice »

I'm not sure why the Metaseq export fails to include 'compatible' normals. I've always just included the final step of saving out with LithUnwrap to complete the application of the normals. There is also an old utility that I use once in a while called 3D Exploration which provides compatible smoothing. I could probably also put together a small program that would smooth the normals of a model exported with LithUnwrap.
StarWraith 3D Games
www.starwraith.com | www.spacecombat.org
3D Space Flight and Combat Simulations
Accountant
Lieutenant
Lieutenant
Posts: 434
Joined: Wed Dec 24, 2008 2:13 am
Location: Milwaukee, WI

Custom Cockpit Shaders Not Showing

Post by Accountant »

Wow, that is beautiful. 3D Exploration seemed to do the trick (with the quick test I did tonight). Thanks for the suggestion.
I could probably also put together a small program that would smooth the normals of a model exported with LithUnwrap.
You never cease to amaze me, Vice. But I am sure your time is better spent on other things ;)

Thanks for taking another look at this for an amateur modder such as myself.

-Accountant
Enforcing GAAP in the outer systems since 2407.

Callsigns: [CPA]Accountant and Dark Helmet
Mods: EL Observation Cockpit | Dragonfly | Swallow | ER/EL Hud Mod | Sphere and Sphere Cockpit