| 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: |
- Pages:
- 1
- 2
| ApplyParralaxAndBumpMap seems to deactivate; lighting for some reason... | |
|---|---|
| Tweet Topic Started: Nov 27 2007, 04:28 AM (693 Views) | |
| Eansis | Nov 27 2007, 04:28 AM Post #1 |
|
ghost
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Whenever I add bumpmapping to an instance the instance can no longer reflect light...
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
| |
![]() |
|
| harkathmaker | Nov 27 2007, 07:01 PM Post #2 |
|
Persistent Enquirer
![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
-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?
|
![]() |
|
| Ruud v A | Nov 27 2007, 08:03 PM Post #3 |
|
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. | |
![]() |
|
| Eansis | Nov 27 2007, 08:27 PM Post #4 |
|
ghost
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
The model in the Bumpmapping example seemed to respond to the lighting, but all the models I make don't...
|
VOTE FOR BUDDY ROEMER HE'S A STRAIGHTFORWARD, DOWN TO EARTH AMERICAN GUY WHO ISN'T PART OF THE BIGBROTHER CONSPIRACY
| |
![]() |
|
| harkathmaker | Nov 28 2007, 03:40 AM Post #5 |
|
Persistent Enquirer
![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Bump mapping uses per pixel, as opposed to per vertex, lighting.
Maybe you could try replacing your model in-game with the example model? Unless you already tried that...Another conundrum
|
![]() |
|
| Ruud v A | Nov 28 2007, 05:35 PM Post #6 |
|
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. | |
![]() |
|
| Eansis | Nov 28 2007, 07:59 PM Post #7 |
|
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!
|
VOTE FOR BUDDY ROEMER HE'S A STRAIGHTFORWARD, DOWN TO EARTH AMERICAN GUY WHO ISN'T PART OF THE BIGBROTHER CONSPIRACY
| |
![]() |
|
| Zip | Nov 28 2007, 08:42 PM Post #8 |
|
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! | |
![]() |
|
| Dr. Best | Nov 28 2007, 08:47 PM Post #9 |
|
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). |
![]() |
|
| Eansis | Nov 29 2007, 05:07 AM Post #10 |
|
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
| |
![]() |
|
| Dr. Best | Nov 29 2007, 04:31 PM Post #11 |
|
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. |
![]() |
|
| NoodleNog | Nov 29 2007, 07:04 PM Post #12 |
|
Advanced Member
![]() ![]() ![]() ![]() ![]()
|
You said vertex lighting where you should have said pixel lighting. Kinda confusing. |
![]() |
|
| Eansis | Nov 30 2007, 01:06 AM Post #13 |
|
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
| |
![]() |
|
| Linkin | Nov 30 2007, 01:39 AM Post #14 |
|
Forum God
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Are you calling ApplyParallaxAndBumpMapping(...) in the step event too? |
![]() Want something done in Photoshop, make a request Here Formerly known as DS-Development. | |
![]() |
|
| harkathmaker | Nov 30 2007, 06:43 PM Post #15 |
|
Persistent Enquirer
![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
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. ![]()
Do you have to do that?
|
![]() |
|
| Go to Next Page | |
| « Previous Topic · Questions about Ultimate 3D · Next Topic » |
- Pages:
- 1
- 2





![]](http://z1.ifrm.com/static/1/pip_r.png)





9:37 PM Jul 11