normal map lighting and position weirdness

For questions about using Classic.

Post » Mon Dec 07, 2009 10:38 pm

Any idea what's going on here? The only way to slow it down is to divide the mouse x/y by some huge number, but even then it seems to be guesswork and the more the mouse moves away from 0,0 the further apart the light and the mouse coords get.

Same happens with using a sprites position for the normal map light too.

Download: here
B
3
S
2
G
3
Posts: 628
Reputation: 2,531

Post » Tue Dec 08, 2009 2:09 am

AFAIK 0 becomes left (or top) and 1 is right (or bottom) of the screen.... screen which is rotated along with the sprite.



Yeah.
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Post » Tue Dec 08, 2009 2:19 am

[quote="Madster":1zphgzi4]AFAIK 0 becomes left (or top) and 1 is right (or bottom) of the screen.... screen which is rotated along with the sprite.



Yeah.[/quote:1zphgzi4]

Yeah :\ So how can you keep the textures lightsource where the mouse pointer is, without the positions eventually becoming out of wack. Using MouseX/somelargenumber improves things, but isn't perfect, the more the mouse moves away from 0,0 the more the two become out of synch. Course use of the mouse was just to make the problem easier to explain. The use of it would be more along the lines of a player moving along with a torch, so it follows as it goes, causing the slight changes to the walls, floor etc. Which would add a nice extra effect to having a regular light effect on top of that.
B
3
S
2
G
3
Posts: 628
Reputation: 2,531

Post » Tue Dec 08, 2009 3:14 am

This is why I wrote Heightmap Plus.... but sometimes heightmaps don't cut it and you really need to use a normal map.

I plan to introduce a normalmap plus effect at some point, with an angle input to compensate effortlessly. You could do the math in events, but yeah it's a bit hard.
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Post » Tue Dec 08, 2009 8:17 am

[quote="Madster":2gdchmbv]This is why I wrote Heightmap Plus.... but sometimes heightmaps don't cut it and you really need to use a normal map.

I plan to introduce a normalmap plus effect at some point, with an angle input to compensate effortlessly. You could do the math in events, but yeah it's a bit hard.[/quote:2gdchmbv]

That would be awesome! And very, very useful. I'll look into heightmap plus in the meantime. I saw it in the list but didn't look into those so much.

*Le sigh* Wish I could code like that, doing little plugins and extra's would be far more useful to the majority, than artwork, which would have to be all specific for every user.
B
3
S
2
G
3
Posts: 628
Reputation: 2,531

Post » Tue Dec 08, 2009 1:02 pm

There's pretty simple calculation that checks the size of screen and does some stuff and you get the light point exactly where you want as example at mouse. Or isn't this what you want?
B
11
S
3
G
4
Posts: 622
Reputation: 3,186

Post » Wed Dec 09, 2009 12:50 am

[quote="Sagal":2pyenggi]There's pretty simple calculation that checks the size of screen and does some stuff and you get the light point exactly where you want as example at mouse. Or isn't this what you want?[/quote:2pyenggi]

Sounds like what I was looking for, yeah. Mouse or Sprite. That would be great!
B
3
S
2
G
3
Posts: 628
Reputation: 2,531


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 2 guests