Specular Lighting

Post requests, images, descriptions and reports about work in progress here.
Topic author
BobHegwood
Posts: 1803
Joined: 12.10.2007
With us: 17 years 5 months

Specular Lighting

Post #1by BobHegwood » 21.10.2007, 14:54

Hey there...

I have finally been able to learn enough about the Anim8or to be able to
add textures to objects and save them in the 3ds format. I have NOT been
able to convert these to the cmod format, however. I'm having real
problems in trying to get the 3dstocmod tools to work in Vista. Sigh...

At any rate, I have repaired the Black Hole add-on so that the Black Hole is
black, but my question here involves specular lighting. Even though I have
made certain that the texture surrounding the Black Hole's center reflects
NO specularity, and contains NO specularity, the star next to the Black
Hole continues to cause a specular reflection on the surface - and edges -
of the new Black Hole outlying texture. What am I doing wrong?

There are also NO specularity properties inherent in the SSC file.

Anyone have advice for this Brain-Dead Geezer?

Thanks, Bob
Brain-Dead Geezer Bob is now using...
Windows Vista Home Premium, 64-bit on a
Gateway Pentium Dual-Core CPU E5200, 2.5GHz
7 GB RAM, 500 GB hard disk, Nvidia GeForce 7100
Nvidia nForce 630i, 1680x1050 screen, Latest SVN

Avatar
selden
Developer
Posts: 10192
Joined: 04.09.2002
With us: 22 years 7 months
Location: NY, USA

Re: Specular Lighting

Post #2by selden » 21.10.2007, 15:49

BobHegwood wrote:Hey there...

I have finally been able to learn enough about the Anim8or to be able to
add textures to objects and save them in the 3ds format. I have NOT been
able to convert these to the cmod format, however. I'm having real
problems in trying to get the 3dstocmod tools to work in Vista. Sigh...
You might try my Anim8or CMOD export script.
http://www.lepp.cornell.edu/~seb/celest ... g.html#4.1
Be sure to read the caveats.

At any rate, I have repaired the Black Hole add-on so that the Black Hole is
black, but my question here involves specular lighting. Even though I have
made certain that the texture surrounding the Black Hole's center reflects
NO specularity, and contains NO specularity, the star next to the Black
Hole continues to cause a specular reflection on the surface - and edges -
of the new Black Hole outlying texture. What am I doing wrong?

There are also NO specularity properties inherent in the SSC file.

Anyone have advice for this Brain-Dead Geezer?

Thanks, Bob


"No specularity properties" does not mean "no specularity". If you don't specify otherwise, Celestia intentionally provides some defaults which cause highlights. If you want no highlights, you'll have to include appropriate specular statements.
Selden

Topic author
BobHegwood
Posts: 1803
Joined: 12.10.2007
With us: 17 years 5 months

Post #3by BobHegwood » 21.10.2007, 16:22

Okay Selden...

As always, THANKS very much for your help. Hang in there for a while. I'll
know what I'm doing again one of these days.

YOU DA MAN!!!
Brain-Dead Geezer Bob is now using...
Windows Vista Home Premium, 64-bit on a
Gateway Pentium Dual-Core CPU E5200, 2.5GHz
7 GB RAM, 500 GB hard disk, Nvidia GeForce 7100
Nvidia nForce 630i, 1680x1050 screen, Latest SVN

Topic author
BobHegwood
Posts: 1803
Joined: 12.10.2007
With us: 17 years 5 months

Post #4by BobHegwood » 21.10.2007, 17:59

Okay,

In the 3ds model itself, I added a specular image (all black) and used it as
part of the model to insure that the specular reflection I'm seeing did NOT
come from the model.

Then, I added SpecularPower 100, and everything else you need in an SSC
file to eliminate specular reflections, including a completely black Specular
image file.

I'm STILL seeing the white reflection on one WHOLE side of the Black Hole.

So... What am I missing? Do I need to make the 3ds image two-sided in
order to handle both sides of the model even though I've coded against
specular reflections in the SSC file?

I know I'm a Bozo, but look at how much fun you all can have while you're
laughing at me. <wink>
Brain-Dead Geezer Bob is now using...
Windows Vista Home Premium, 64-bit on a
Gateway Pentium Dual-Core CPU E5200, 2.5GHz
7 GB RAM, 500 GB hard disk, Nvidia GeForce 7100
Nvidia nForce 630i, 1680x1050 screen, Latest SVN

Avatar
selden
Developer
Posts: 10192
Joined: 04.09.2002
With us: 22 years 7 months
Location: NY, USA

Post #5by selden » 21.10.2007, 18:41

Bob,

It really isn't as obvious as you'd like, so it really isn't a laughing matter.

For example, only SSC Texture definitions get applied to Meshes. SSC SpecularTextures (and all other texture types) are ignored :(

Or do you mean that you specified a black specular texture file in the material definition in Anim8or?

Hmm. I think your "real problem" is something else.

I just now tried defining a material in Anim8or, specifying a diffuse power of 0,
a dark grey diffuse color, (R=G=B=70)
low specuar power (0.001) with a black specular color (R=G=B=2; there's no need for a texture). It seems to work fine in my simple test case.

I did not specify any specularity options in its SSC file.

The dark side of a spherical model is black and the sunlit side is a smoothly graduated dark grey with no highlights.
Selden

Topic author
BobHegwood
Posts: 1803
Joined: 12.10.2007
With us: 17 years 5 months

Post #6by BobHegwood » 21.10.2007, 19:24

Well, thanks again Selden.

I guess I'll just hafta play with it some more, but it's bugging me now.
More than likely, it's something I'm doing in Anim8or, but I'm running
out of things to try here.

That's alright, you KNOW how persistent I can be. <grin>
Again, many thanks for your help as always.
Brain-Dead Geezer Bob is now using...
Windows Vista Home Premium, 64-bit on a
Gateway Pentium Dual-Core CPU E5200, 2.5GHz
7 GB RAM, 500 GB hard disk, Nvidia GeForce 7100
Nvidia nForce 630i, 1680x1050 screen, Latest SVN

Topic author
BobHegwood
Posts: 1803
Joined: 12.10.2007
With us: 17 years 5 months

Post #7by BobHegwood » 22.10.2007, 21:07

Okay,

I SOLVED my specular lighting problem, but you are NOT gonna believe
what it took to fix it...

After exhausting ALL other possibilities, I went to:

C:\Program Files\Celestia\shaders and then REMOVED 3 files.

1. specular.vp
2. specular2_arb.vp
3. specular_arb.vp

My textures looked as they should have to me when I ran Celestia.

Next, I went back and RESTORED each of these files - one at a time.
When I had finished restoring ALL of the folders - re-running Celestia
between each restoration so that I could pinpoint the problem .vp file -
I no longer had any specularity problems.

Explain THAT one to me, Selden. :roll:
Brain-Dead Geezer Bob is now using...
Windows Vista Home Premium, 64-bit on a
Gateway Pentium Dual-Core CPU E5200, 2.5GHz
7 GB RAM, 500 GB hard disk, Nvidia GeForce 7100
Nvidia nForce 630i, 1680x1050 screen, Latest SVN

Avatar
selden
Developer
Posts: 10192
Joined: 04.09.2002
With us: 22 years 7 months
Location: NY, USA

Post #8by selden » 22.10.2007, 21:36

gremlins
Selden

Topic author
BobHegwood
Posts: 1803
Joined: 12.10.2007
With us: 17 years 5 months

Post #9by BobHegwood » 22.10.2007, 21:41

selden wrote:gremlins


No, no... You don't get off THAT easily. Honestly, I spent approximately
8 hours investigating all aspects of this problem, and now I want an
answer.

In lieu of that, how about an explanation of what these files are. Are
these Perl scripts? Honestly, I really do NOT know what they are. Since
they just caused me so much grief, however, I'm gonna find out what they
are and MESS with them. Screw with me willya? :lol:
Brain-Dead Geezer Bob is now using...
Windows Vista Home Premium, 64-bit on a
Gateway Pentium Dual-Core CPU E5200, 2.5GHz
7 GB RAM, 500 GB hard disk, Nvidia GeForce 7100
Nvidia nForce 630i, 1680x1050 screen, Latest SVN

Avatar
selden
Developer
Posts: 10192
Joined: 04.09.2002
With us: 22 years 7 months
Location: NY, USA

Post #10by selden » 22.10.2007, 21:56

Bob,

My only guess from what you've written is that maybe you made a typo when restoring the files so that one of them isn't actually restored (i.e. was restored with a different name from what it had originally, so Celestia isn't finding it). In that case, though, I'd expect there to be an error message in the tilde console log.

Those files contain OpenGL vertex shader programs.
It's a simple, standardized programming language used with all graphics cards compatible with OpenGL v1.4. It tells the card how to manipulate the colors of each pixel as determined by the illumination of each vertex in a model. Each card's manufacturer has to provide a compiler as part of their graphics driver library which converts that generic text into the proprietary binary code recognized by their graphics cards -- this compiler is one of the reasons the graphics drivers are so large.
Selden

Topic author
BobHegwood
Posts: 1803
Joined: 12.10.2007
With us: 17 years 5 months

Post #11by BobHegwood » 22.10.2007, 23:57

selden wrote:Bob,

My only guess from what you've written is that maybe you made a typo when restoring the files so that one of them isn't actually restored


Sorry Selden, but I did NO such thing. I MOVED each of these three files
OUT of the Celestia directory, and then I MOVED them back to their
original locations. This was ALL done via Vista's built-in MOVE function,
and I did not even have to spell the things. I simply selected them via
mouse-click.

okay, NOW I'll leave ya alone. :roll:

Besides, I think the real problem here is Vista. (Surprise, surprise...)
Brain-Dead Geezer Bob is now using...
Windows Vista Home Premium, 64-bit on a
Gateway Pentium Dual-Core CPU E5200, 2.5GHz
7 GB RAM, 500 GB hard disk, Nvidia GeForce 7100
Nvidia nForce 630i, 1680x1050 screen, Latest SVN

Topic author
BobHegwood
Posts: 1803
Joined: 12.10.2007
With us: 17 years 5 months

Post #12by BobHegwood » 23.10.2007, 22:07

One final note here...

Methinks that my HP graphics display is to blame for my travails inside
specularity.

After I updated the display software via HP, my specularity problems
immediately returned. Thus, I have permanently REMOVED the specular
shaders from the Celestia sub-directory. I had to do this because there are
no adjustments within HP for specularity. At least, none I can find in my
version of the software.

I'll be updating my signature again here in a moment so people can see
what to avoid?

Thanks, Bob
Brain-Dead Geezer Bob is now using...
Windows Vista Home Premium, 64-bit on a
Gateway Pentium Dual-Core CPU E5200, 2.5GHz
7 GB RAM, 500 GB hard disk, Nvidia GeForce 7100
Nvidia nForce 630i, 1680x1050 screen, Latest SVN

ANDREA
Posts: 1543
Joined: 01.06.2002
With us: 22 years 10 months
Location: Rome, ITALY

Post #13by ANDREA » 23.10.2007, 22:17

BobHegwood wrote:... I'll be updating my signature again here in a moment so people can see what to avoid Thanks, Bob

Bob, we are missing one information, i.e. if you use Vista 32 or 64 bit. :wink:
It's important to know it, IMO.
Bye

Andrea :D
"Something is always better than nothing!"
HP Omen 15-DC1040nl- Intel® Core i7 9750H, 2.6/4.5 GHz- 1TB PCIe NVMe M.2 SSD+ 1TB SATA 6 SSD- 32GB SDRAM DDR4 2666 MHz- Nvidia GeForce GTX 1660 Ti 6 GB-WIN 11 PRO

chris
Site Admin
Posts: 4211
Joined: 28.01.2002
With us: 23 years 2 months
Location: Seattle, Washington, USA

Post #14by chris » 23.10.2007, 22:24

For what it's worth, the OpenGL 2.0 render path doesn't actually use the shader files. In that path, the shaders are assembled from fragments at run time to cover all the possible combinations of surface properties, light sources, and shadows.

--Chris

Topic author
BobHegwood
Posts: 1803
Joined: 12.10.2007
With us: 17 years 5 months

Post #15by BobHegwood » 23.10.2007, 22:27

chris wrote:For what it's worth, the OpenGL 2.0 render path doesn't actually use the shader files. In that path, the shaders are assembled from fragments at run time to cover all the possible combinations of surface properties, light sources, and shadows.

--Chris


If that's the case, then why does removing them from my version of
Celestia CORRECT the problem? Still confused - but happy Bob. Using 32-bit
Windows Vista Home Premium.
Brain-Dead Geezer Bob is now using...
Windows Vista Home Premium, 64-bit on a
Gateway Pentium Dual-Core CPU E5200, 2.5GHz
7 GB RAM, 500 GB hard disk, Nvidia GeForce 7100
Nvidia nForce 630i, 1680x1050 screen, Latest SVN

Avatar
cartrite
Posts: 1978
Joined: 15.09.2005
With us: 19 years 6 months
Location: Pocono Mountains, Pennsylvania, USA Greate Grandfother from Irshava, Zakarpattia Oblast Ukraine

Post #16by cartrite » 23.10.2007, 22:59

Hey Bob,
Are you sure that your not in different rendering modes when this specularity issue comes and goes. I think that basic and multitexture modes don't have the specular effects.
cartrite
VivoBook_ASUSLaptop X712JA_S712JA Intel(R) UHD Graphics 8gb ram. Intel(R) Core(TM) i5-1035G1 CPU @ 1.00GHz, 1190 Mhz, 4 Core(s), 8 Logical Processor(s) 8 GB ram. Running on Windows 11 and OpenSuse 15.4

Topic author
BobHegwood
Posts: 1803
Joined: 12.10.2007
With us: 17 years 5 months

Post #17by BobHegwood » 24.10.2007, 04:33

cartrite wrote:Hey Bob,
Are you sure that your not in different rendering modes when this specularity issue comes and goes. I think that basic and multitexture modes don't have the specular effects.
cartrite


Now that's a GOOD question...

I have not a clue. Where do I find these settings? I vaguely remember the
terms, but I have not been given the opportunity to select one anywhere
in the setup of Celestia, or my new PC. Let me look around a bit.

Note: Just had a look and was running in Windowed mode WITHOUT
specularity problems after I removed the offending shaders.
When I reset the render mode to 1680x1050x32, these specularity
problems re-occurred after I had moved the shaders back to their
proper locations. Methinks that the problem lies within the HP graphics
on the machine. Will probably remove the shaders again.

BTW, I'm using the very latest OpenGL drivers 2.11 if I recall correctly.

Thanks very much for the advice.
Brain-Dead Geezer Bob is now using...
Windows Vista Home Premium, 64-bit on a
Gateway Pentium Dual-Core CPU E5200, 2.5GHz
7 GB RAM, 500 GB hard disk, Nvidia GeForce 7100
Nvidia nForce 630i, 1680x1050 screen, Latest SVN

Avatar
cartrite
Posts: 1978
Joined: 15.09.2005
With us: 19 years 6 months
Location: Pocono Mountains, Pennsylvania, USA Greate Grandfother from Irshava, Zakarpattia Oblast Ukraine

Post #18by cartrite » 24.10.2007, 07:24

Bob,
The rendering "mode or PATH", changes when you press the "ctrl v" keys at the same time. Depending on the version of Celestia, different modes do different things.
In Celestia 1.5prex or the cvs version, most if not all of the new enhancements only work in rendering mode OGL2. Keep hitting the ctrl v keys until it cycles through all. Basic, multitexture, Opengl vertex program, Openglvertex/Nvidia combiners, and Opengl 2.0. Specularity effects don't work in Basic or mutitexture. Window size makes no difference.
cartrite
VivoBook_ASUSLaptop X712JA_S712JA Intel(R) UHD Graphics 8gb ram. Intel(R) Core(TM) i5-1035G1 CPU @ 1.00GHz, 1190 Mhz, 4 Core(s), 8 Logical Processor(s) 8 GB ram. Running on Windows 11 and OpenSuse 15.4

Topic author
BobHegwood
Posts: 1803
Joined: 12.10.2007
With us: 17 years 5 months

Post #19by BobHegwood » 24.10.2007, 09:41

Okay, Cartrite...

Looks as if render path OpenGL 2.0 is the one giving me the specularity
problems. I seem to get the best displays using the multi-texture mode.

I can also go to the vertex, Nvidia and more exotic paths, but then
Celestia slows to a crawl and the frame rate drops down to 1 or 2 per sec.

If I simply stay in the multi-texture mode, I seem to have the best display
as well as performance. This was very useful, and thanks again for
pointing me at the resource.

EDIT: NOW I'm having specularity problems in multi-texture too. I was
looking at the new ISS and all of the panels went completely white when
they reflected the Sun. I do mean COMPLETELY white. Any other
suggestions?

Take care, Bob
Brain-Dead Geezer Bob is now using...
Windows Vista Home Premium, 64-bit on a
Gateway Pentium Dual-Core CPU E5200, 2.5GHz
7 GB RAM, 500 GB hard disk, Nvidia GeForce 7100
Nvidia nForce 630i, 1680x1050 screen, Latest SVN

Topic author
BobHegwood
Posts: 1803
Joined: 12.10.2007
With us: 17 years 5 months

Post #20by BobHegwood » 25.10.2007, 21:29

A PICTURE is worth a thousand words, Selden...

Image

Any ideas? When I follow the ISS for a bit, or when the Sun is no longer
shining brightly on the solar panels, I see the nice new BROWN color that
Mr. Hundley kindly added for me. <smirk>

This, BTW, was in Multi-Texture mode on my machine. All NVIDIA software
updated to the latest, and this was WITH those damned shaders back IN
their Celestia directory.

Thanks again, Bob
Brain-Dead Geezer Bob is now using...
Windows Vista Home Premium, 64-bit on a
Gateway Pentium Dual-Core CPU E5200, 2.5GHz
7 GB RAM, 500 GB hard disk, Nvidia GeForce 7100
Nvidia nForce 630i, 1680x1050 screen, Latest SVN


Return to “Add-on development”