Discuss Scratch

kanomaster
Scratcher
100+ posts

Shadow Rendering

I'm having trouble incorporating @banbot2's Shadow Engine into my top down scrolling project. To make it easier to understand the circumstances surrounding the coding I'm going to list the problems of my projects incorporation, and the differences between my project and @banbot2's
My project:
  • Incorporates a “zoom” function that allows you to shrink/expand the size of the map.
  • Significantly larger map.
  • Uses costume glitch to scroll using one costume of a sprite that has been “zoomed in” to perceive a larger then life map.
Banbot's Example:
  • No zoom function/costume glitch. The entire scrolling map he's added is one costume that has art that extends outside the little blue window that is only available in vector art. (Bitmap doesn't allow you to add art outside this window, while vector does, both of us use vector for art tho)
Will the shadow engine only work with the non costume-glitch scrolling method that he has employed? Or is there another way? Thanks to anybody who can help!
kanomaster
Scratcher
100+ posts

Shadow Rendering

bump!
deck26
Scratcher
1000+ posts

Shadow Rendering

Please don't bump after less than 24 hours since your last post.

I'm just going to repeat what I said on my profile. It will be much easier to help if you produce a much simpler version of this. You understand how your project works so it is easier for you do that than for anyone trying to help deleting the bullet, thumbnail and anything else that's not relevant. In fact it might be easier for you to start again. If you can get it down to two or three sprites and fewer than 200 blocks it will be much easier to look at.

Otherwise I have to say I'm not going to try to help on this but just because, as I've already said, this is not an area of coding I've done anything on and don't really understand what it is you're trying to achieve. Hopefully someone else will better understand.

Last edited by deck26 (Feb. 13, 2025 12:36:16)

kanomaster
Scratcher
100+ posts

Shadow Rendering

deck26 wrote:

Please don't bump after less than 24 hours since your last post.

I'm just going to repeat what I said on my profile. It will be much easier to help if you produce a much simpler version of this. You understand how your project works so it is easier for you do that than for anyone trying to help deleting the bullet, thumbnail and anything else that's not relevant. In fact it might be easier for you to start again. If you can get it down to two or three sprites and fewer than 200 blocks it will be much easier to look at.

Otherwise I have to say I'm not going to try to help on this but just because, as I've already said, this is not an area of coding I've done anything on and don't really understand what it is you're trying to achieve. Hopefully someone else will better understand.
nvm I figured it out
imfh
Scratcher
1000+ posts

Shadow Rendering

Edit: Ninja'd

Ok, so first of all, under your raycast shadows receiver, you set the size to (zoom * 20). That is going to totally break the shadow engine because all of the clones will be the exact same size. Change that to something like:

set size to ((Clone Identification) * ((Zoom) * (0.2))) %

Next, for some reason, under Make Clones, you are starting Index on a negative number and you are also making it smaller. Fix those numbers to match what is shows in the demo project.

Those two fixes should make an improvement, but it still doesn't look quite right. The shadows look more like walls than shadows. For further testing, I would set the number clones created in the loop to 10 instead of 120.

I suspect something might be wrong with how you set the position of the shadows. Maybe the shadows need to move more?

Last edited by imfh (Feb. 13, 2025 16:34:44)

kanomaster
Scratcher
100+ posts

Shadow Rendering

imfh wrote:

Edit: Ninja'd

Ok, so first of all, under your raycast shadows receiver, you set the size to (zoom * 20). That is going to totally break the shadow engine because all of the clones will be the exact same size. Change that to something like:

set size to ((Clone Identification) * ((Zoom) * (0.2))) %

Next, for some reason, under Make Clones, you are starting Index on a negative number and you are also making it smaller. Fix those numbers to match what is shows in the demo project.

Those two fixes should make an improvement, but it still doesn't look quite right. The shadows look more like walls than shadows. For further testing, I would set the number clones created in the loop to 10 instead of 120.

I suspect something might be wrong with how you set the position of the shadows. Maybe the shadows need to move more?
I think its because they look kinda fuzzy looking, (and they look fuzzy looking because of how big the shadows are? (As they get larger you can see more detail, which there isn't much, so it looks fuzzy?) Also I think its hilarious you responded to me with the solution that I just figured out literally a minute prior. (had to look up what “ninja'd” meant.)

Edit: I just realized how confusing what I wrote must've looked. In the costume of any sprite the smallest detail for a drawing is a pixel. When I zoom this costume in by some 20ish times, Each pixel in the costume translates to more like 20 in the game. Or smth, idk, but I know that if you have a lot of detail in a costume and then zoom it in, it becomes alot blurrier, and I think that's what's causing the wall-illusion.

Last edited by kanomaster (Feb. 14, 2025 00:52:33)

Powered by DjangoBB