Bumpmap light rotates along with object

For questions about using Classic.

Post » Mon Nov 23, 2009 9:42 pm

The bumpmapping effect's light rotates along with object, which is kind of silly.

Is there a reason for this? Are there any simple ways around it? I wanted to rotate an object that was lit by the side, showing its all of its bumpyness, but as it is now, I might as well bake the light in.
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Post » Tue Nov 24, 2009 12:22 am

I just tried to fix the shader but my shader skills aint up to snuff.

Anyone? I believe the effect is just lacking some matrix rotation
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Post » Tue Nov 24, 2009 3:54 am

Are you using it on the object, or the layer?
Image Image
B
161
S
48
G
89
Posts: 7,347
Reputation: 66,249

Post » Tue Nov 24, 2009 7:47 am

the object :s am I supposed to do otherwise?
I just put it on the layer now and it still looks wrong.

If I turn the bumpmap sprite's rotation off, it looks okay (when going around the light source, the shadows oppose it). I had to look at the fx file to figure out that the x and y positions are 0 to 1 across the screen.

If I turn the bumpmap sprite's rotation on, the shadows spin along with the bumpmap. This is wrong.

Also, the transparent parts of the bumpmap layer still affect the underlying layers (move the ship around and watch it get lit) and the unlit parts are gray instead of black. I would suggest an ambient term parameter (which I'd be setting to 0 for this game).

This is the .cap file, please have a look. The bumpmapping effect needs to account for rotation of the bumpmap (leading to eye popping visuals!), but I don't know how to fix it (I noticed it's doing a simple unrotated displacement though). Toggle the angle update action to see the uglyness.

[url:hk9luzoo]http://www.udec.cl/~jfuente_alba/asteroids.cap[/url:hk9luzoo]

Edit: just figured out the correct terminology: the bumpmap effect is being done in object space, should be world space.
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Post » Tue Nov 24, 2009 8:52 pm

And I think that you can't rotate bump maps so you would have to use height maps if im not completely wrong?

EDIT cuz of me being blind!
B
11
S
3
G
4
Posts: 622
Reputation: 3,186

Post » Tue Nov 24, 2009 9:00 pm

However, normal maps cannot be rotated, since the 3D data is only valid for an angle of 0 degrees. If you want to apply bumpmapping to a rotating object, you can only use heightmapping

Thats what the wiki says!
B
11
S
3
G
4
Posts: 622
Reputation: 3,186

Post » Wed Nov 25, 2009 7:25 pm

grumble. Fancy hardware going to waste. grumble.

Guess I'll wind up making a new bumpmap effect then.
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Post » Wed Nov 25, 2009 7:40 pm

I'll tell you a secret if you fix my VRAM problems im having now :D
B
11
S
3
G
4
Posts: 622
Reputation: 3,186

Post » Thu Nov 26, 2009 11:51 pm

Uh.. I could always try.

Also, I like secrets.
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Post » Fri Nov 27, 2009 12:57 pm

Hehe I fixed VRAM problems already but use heightmaps :P Give em a shot
B
11
S
3
G
4
Posts: 622
Reputation: 3,186

Next

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 1 guest