Welcome Guest [Log In] [Register]
We hope you enjoy your visit.


You're currently viewing the Ultimate 3D Community as a guest. This means that you can only read posts, but can not create posts or topics by yourself. To be able to post you need to register. Then you can participate in the community active and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.

Join our community!

If you are already a member please log in to your account to access all of our features:

Username:   Password:
Add Reply
ApplyParralaxAndBumpMap seems to deactivate; lighting for some reason...
Topic Started: Nov 27 2007, 04:28 AM (695 Views)
Eansis
Member Avatar
ghost
[ *  *  *  *  *  * ]
Whenever I add bumpmapping to an instance the instance can no longer reflect light... :huh:

RecalculateNormals() doesn't do anything.

"This information overwrites another piece of information called the vertex normal that is necessary for the usual per vertex lighting. For this reason all meshes using a material that uses parallax or bump mapping can't use the usual lighting for another material. If you want to switch from per pixel lighting back to per vertex lighting, you have to call RecalculateNormals() first."

Does this mean bumpmapped stuff cannot be lighted?
VOTE FOR BUDDY ROEMER HE'S A STRAIGHTFORWARD, DOWN TO EARTH AMERICAN GUY WHO ISN'T PART OF THE BIGBROTHER CONSPIRACY

Til'c
 
Things will not calm down Daniel Jackson. They will infact calm up.
Offline Profile Quote Post Goto Top
 
harkathmaker
Member Avatar
Persistent Enquirer
[ *  *  *  *  * ]
Quote:
 
You can't use environment mapping or other multi texturing effects simultaneously with parallax and bump mapping, nor can you use other shader effects for this material. Ultimate 3D will calculate something called inverse tangent space matrices when enabling the effect. ... For this reason all meshes using a material that uses parallax or bump mapping can't use the usual lighting for another material.

-From U3D help file

So I guess you can't use vertex lighting while using bumpmapping.
Maybe it's a bug... or else there's some way to deactivate bump mapping? :think:
Offline Profile Quote Post Goto Top
 
Ruud v A
Member Avatar
Programmer · Artist
[ *  *  *  *  * ]
Can't use vertex lighting? Bump mapping needs the lighting! It is based on the lighting...

Veniogames
Vēnit, ut mē occidĕret.

I will not use Ultimate3d 2.x.x anymore - I am an Ogre C++ programmer.
Offline Profile Quote Post Goto Top
 
Eansis
Member Avatar
ghost
[ *  *  *  *  *  * ]
The model in the Bumpmapping example seemed to respond to the lighting, but all the models I make don't... :dunno:
VOTE FOR BUDDY ROEMER HE'S A STRAIGHTFORWARD, DOWN TO EARTH AMERICAN GUY WHO ISN'T PART OF THE BIGBROTHER CONSPIRACY

Til'c
 
Things will not calm down Daniel Jackson. They will infact calm up.
Offline Profile Quote Post Goto Top
 
harkathmaker
Member Avatar
Persistent Enquirer
[ *  *  *  *  * ]
Quote:
 
Can't use vertex lighting? Bump mapping needs the lighting! It is based on the lighting...


Bump mapping uses per pixel, as opposed to per vertex, lighting. ;)

Quote:
 
The model in the Bumpmapping example seemed to respond to the lighting, but all the models I make don't...


:dunno: Maybe you could try replacing your model in-game with the example model? Unless you already tried that...
Another conundrum :sad:
Offline Profile Quote Post Goto Top
 
Ruud v A
Member Avatar
Programmer · Artist
[ *  *  *  *  * ]
I thought the input of the per-pixel shader was the vertex lighting... :S

Veniogames
Vēnit, ut mē occidĕret.

I will not use Ultimate3d 2.x.x anymore - I am an Ogre C++ programmer.
Offline Profile Quote Post Goto Top
 
Eansis
Member Avatar
ghost
[ *  *  *  *  *  * ]
Ah...the link to the bumpmap example is broken and I no longer have the link on my pc...if someone could post a new link that would be awesome! :D
VOTE FOR BUDDY ROEMER HE'S A STRAIGHTFORWARD, DOWN TO EARTH AMERICAN GUY WHO ISN'T PART OF THE BIGBROTHER CONSPIRACY

Til'c
 
Things will not calm down Daniel Jackson. They will infact calm up.
Offline Profile Quote Post Goto Top
 
Zip
Member Avatar
Forum Leader
[ *  *  *  *  * ]
when calling ApplyParallaxAndBumpMapping() you have to provide the id of three lights, only the first can be directional light; no spot lights (it is all in the manual ;) )
Sorry if i've made some errors, I'm not english!
Offline Profile Quote Post Goto Top
 
Dr. Best
Member Avatar
Administrator
[ *  *  *  *  *  * ]
As you enable parallax and/or bump mapping the model will be lit exceptionally by the given (up to three) light sources after that. As stated in the part of the help file, which is quoted above, you can't have per-pixel-lighting and per-vertex-lighting on different materials of the same mesh at the same time. So either you have three light sources to be used for per-pixel-lighting or you have all light sources to be used for per-vertex-lighting.

P.S.: I moved this to the Questions-section. The game graphics section is meant to deal only with anything that's related to Ultimate 3D game making resources (models, shaders, textures, software).
Offline Profile Quote Post Goto Top
 
Eansis
Member Avatar
ghost
[ *  *  *  *  *  * ]
Yes that is the strange part. The light sources are defined in ApplyParalaxAndBumpMap but they don't light the model. Remember in the bumpmap example the model had vertex lighting sumhow, remember the colors.
VOTE FOR BUDDY ROEMER HE'S A STRAIGHTFORWARD, DOWN TO EARTH AMERICAN GUY WHO ISN'T PART OF THE BIGBROTHER CONSPIRACY

Til'c
 
Things will not calm down Daniel Jackson. They will infact calm up.
Offline Profile Quote Post Goto Top
 
Dr. Best
Member Avatar
Administrator
[ *  *  *  *  *  * ]
Are you calling RecalculateNormals()? You shouldn't be doing so because calling this function will make the inverse tangent space matrices come invalid and as a result of this per pixel lighting won't work correctly. If this doesn't solve the problem please show us pieces of your code and describe what happens more detailed.

I think you have misunderstood the meaning of the term per-vertex-lighting. It wasn't used anywhere in the parallax and bump mapping example. Per-vertex-lighting is the lighting that is used by default for all objects. By calling ApplyParallaxAndBumpMapping(...) you disable per-vertex-lighting and enable per-pixel-lighting.

Edit: Corrected what NoodleHog noted.
Offline Profile Quote Post Goto Top
 
NoodleNog
Advanced Member
[ *  *  * ]
Dr. Best
Nov 29 2007, 02:31 PM
...you disable per-vertex-lighting and enable per-vertex-lighting.

You said vertex lighting where you should have said pixel lighting. Kinda confusing.
Offline Profile Quote Post Goto Top
 
Eansis
Member Avatar
ghost
[ *  *  *  *  *  * ]
Alright here is my code:
z=GetTerrainHeightAtPos(snowmap, x, y)-1
file="models/Tree0.x"
LoadMesh()
scalx=2
scaly=2
scalz=2

if Global.BumpMapping=1 {LoadHeightMap(600, "gfx/Bark1Bump.BMP", 16)
ApplyParallaxAndBumpMapping(1,600, .02,light_point,0,0)
}
VOTE FOR BUDDY ROEMER HE'S A STRAIGHTFORWARD, DOWN TO EARTH AMERICAN GUY WHO ISN'T PART OF THE BIGBROTHER CONSPIRACY

Til'c
 
Things will not calm down Daniel Jackson. They will infact calm up.
Offline Profile Quote Post Goto Top
 
Linkin
Member Avatar
Forum God
[ *  *  *  *  *  * ]
Are you calling ApplyParallaxAndBumpMapping(...) in the step event too?
Posted Image
Want something done in Photoshop, make a request Here

Formerly known as DS-Development.
Offline Profile Quote Post Goto Top
 
harkathmaker
Member Avatar
Persistent Enquirer
[ *  *  *  *  * ]
NoodleNog
Nov 29 2007, 09:04 AM
Dr. Best
Nov 29 2007, 02:31 PM
...you disable per-vertex-lighting and enable per-vertex-lighting.

You said vertex lighting where you should have said pixel lighting. Kinda confusing.

No, Dr. Best was correct. It does disable per-vertex, and enables per-pixel lighting when using bump mapping. At least that's how it is always explained in the manual. :lol:

Quote:
 
Are you calling ApplyParallaxAndBumpMapping(...) in the step event too?


Do you have to do that? :blink:
Offline Profile Quote Post Goto Top
 
Go to Next Page
« Previous Topic · Questions about Ultimate 3D · Next Topic »
Add Reply