[SOLVED] How to draw the floor in raycasters - scaling problem
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: How to draw the floor in raycasters - scaling problem
And here are the phone screenshots. Weird, isn't it ?
Re: How to draw the floor in raycasters - scaling problem
It's indeed a problem with DPI scaling.
I can get it working by adding in conf.lua. But the text is messed up (really tiny) and it's pretty slow (because the screen has a massive number of pixels, I suppose).
Guess I'll have to put it back to "true" and find a way to deal with DPI stuff in the shader. If you have any docs about it, I'd be very glad.
Thank you to everyone.
I can get it working by adding
Code: Select all
t.window.usedpiscale = false
Guess I'll have to put it back to "true" and find a way to deal with DPI stuff in the shader. If you have any docs about it, I'd be very glad.
Thank you to everyone.
Re: How to draw the floor in raycasters - scaling problem
There's love.window.toPixels and love.window.fromPixels to convert back and forth, and love.graphics.getDPIScale to get the units-to-pixels ratio. Not sure where that will be necessary. If you're using canvases, you can specify dpiscale = 1 for the canvas; see love.graphics.newCanvas.
Re: How to draw the floor in raycasters - scaling problem
Hey guys !
I finally solved the problem. After a lot of debugging, I found that the DPI scaling was not the cause of the problem... My calculations were. I was calculating some lengths in "units" (according to my grid) and some in pixels. For a reason I don't really know, it seemed ok on my computer when it shouldn't have.
Now that it's done, I can focus on game mechanics (the best part)
Thanks again to everyone.
I finally solved the problem. After a lot of debugging, I found that the DPI scaling was not the cause of the problem... My calculations were. I was calculating some lengths in "units" (according to my grid) and some in pixels. For a reason I don't really know, it seemed ok on my computer when it shouldn't have.
Now that it's done, I can focus on game mechanics (the best part)
Thanks again to everyone.
- Jasoco
- Inner party member
- Posts: 3727
- Joined: Mon Jun 22, 2009 9:35 am
- Location: Pennsylvania, USA
- Contact:
Re: [SOLVED] How to draw the floor in raycasters - scaling problem
I'll echo this statement. I was working on a Wolfenstein style ray caster a while ago. A few times actually. I had started the project years ago and gave up for a while before coming back to it. I put a lot of work into it and made it look really really neat with a lot of features, but in the end it was always an issue of the raycasting itself using a lot of CPU time. So if you were looking in a direction where there's a lot of tiles, even ones you really can't actually see, it would use more CPU time and sometimes slow things down even on a small enough map.
Then Groverburger released his g3d engine and I switched over to it. It's much more efficient to just use 3D and pretend it's 2D than to do it in 2D. It's ironic but it's true. I'm still working on getting my new true 3D engine up to par with my old 2D Raycaster though because there were a bunch of things I could do with the raycaster that I can't do as easily with true 3D. But I'll figure it out I'm sure.
Who is online
Users browsing this forum: Bing [Bot] and 7 guests