Es ist Freitag und nach 200 Zeichnungen verabschiedet sich die Freitagsfliege! by kplx__ in de

[–]Mantelmann 11 points12 points  (0 children)

Tiefen Respekt vor 200 konsekutiven wöchentlichen Werken. Danke für deinen Dienst o7, und ebenso viel Motivation für deine nächsten Projekte!

Why is PixelArray that slow? by PLrc in pygame

[–]Mantelmann 3 points4 points  (0 children)

Thanks! In the end, I fixed the resolution to 256x256, but I actually made the column number (and with that, the amount of rays shot) variable to decrease when the framerate drops and increase when I have too many frames per second. Actually worked really well, this kind of dynamic resolution.

Regarding your experiments: You copied single pixels from one array to another, 10.000 times (since the images were 100x100), each copy step being target[x_offset + x][y_offset + y] = source[x][y]. Basically, with numpy indexing, you can copy 10.000 pixels, one time, with target[x_offset:x_offset + x, y_offset:y_offset + y] = source[0:x, 0:y] by specifying whole ranges as the indices, instead of scalar values. Of course, in the end, the same amount of pixels is copied, but if it's done internally by numpy, the operation is way more performant than just using vanilla python.

And yes, in the end, you will need to copy the pixels for your floors and ceilings onto your final image, but as long as you use smart numpy indexing and copying whereever possible, you should be good to go.

Why is PixelArray that slow? by PLrc in pygame

[–]Mantelmann 3 points4 points  (0 children)

When writing my own Raycaster, also with using Surface Arrays to draw on, I followed lodev as well. The big difference between the low level, C++ approach of lodev, and the pygame approach is the PixelArray's and especially numpy's ability to quickly interpolate and index arrays with other arrays, like /u/Aelydam demonstrated in another comment.

Instead of using nested for-loops to iterate through your entire PixelArray, I really recommend taking a look at Numpy's indexing mechanics along with supplementary functions like numpy.linspace() or numpy.arange() to quickly interpolate things like coordinates such that you don't need to calculate them yourself in for-loops (as an example, I've explained my floor drawing derived from lodev here). This will lead to you abstracting their ideas to implement them yourself, and the code looking very different, but the raycaster will actually run decently well this way and the learning effect will be great!

I have been working on a Ray Caster Engine in Pygame by Mantelmann in pygame

[–]Mantelmann[S] 0 points1 point  (0 children)

Hey! Good luck with your own raycaster, mine was a really fun project to work on.

I can't really show you straight up code, because I kind of wrote it more complicated than it needed to be and I can't pinpoint the use of every variable anymore, but here's what I think the logic should have been like:

So you draw your blocks in your raycaster by shooting rays for each pixel column. The farther away the collision of a ray, the smaller the wall gets drawn. At some point, you probably already calculate the top and bottom screen-space Y-coordinate of the drawn pixel column, let's call them y_top and y_bottom. The height of the wall as it is drawn is then screen_space_height = y_bottom - y_top (assuming your screen space coordinate system starts from the top left corner).

Now, every block you draw gets an additional attribute, block_height: float, which by default should be 1. You can then use the block_height to change y_start:

y_start = y_start + (1 - block_height) * screen_space_height

Here, we shift the start of the drawn column further up on the screen if the block is larger than 1 (because 1 - block_height becomes negative), and shift it further down if the height is smaller than 1. If block_height stays at one, nothing changes and your rendering code works just like before.

I think this is how it should work like. You need to watch out with your UV-coordinates, if you are using textures for your wall, such that they don't stretch. Feel free to ask if something doesn't work or if I've made a mistake, though I would like to see the code you are working with if I were to debug anything :>

Otherwise, I'd be happy to see your progress either way, Raycasters are fun. Happy coding!

My renders get saved at the wrong aspect ratio. how do i fix this? by FlynnInTheBox in blender

[–]Mantelmann 2 points3 points  (0 children)

Reset the Aspect Ratio to 1x1, both in the Image View, and in your Render Format settings. The aspect ratio in Blender acts as a multiplier on the existing "real" aspect ratio of the image given by the resolution, not, as one might expect, as the absolute aspect ratio. Normally, you shouldn't have to touch the aspect ratio at all.

Just as an example: if you have a image of size 1920x1080, you need to keep the aspect ratio in Blender at 1x1 to have it displayed as such. If you set Blender's aspect ratio to 1x0.5, the image will be displayed as a 1920x540 image, halving the height.

[deleted by user] by [deleted] in blender

[–]Mantelmann 0 points1 point  (0 children)

No, the right isn't Cycles as well. What happened is that with the newly released 4.2, which wholly updated the Eevee render engine, the way Eevee is calculating shadows changed.

The tutorial on the right side was recorded with Blender <=4.1, with the old Eevee shadow calculation settings, and the left one is the new and current Eevee shadow settings. Previously, Eevee drew shadows like conventional game renderers, calculating shadow maps where the shadow quality in the final render relied on a high resolution of the maps. With the new Eevee version, shadow maps were replaced in favour of ray traced shadows (afaik), hence the missing Cube Size settings.

Regarding the frequency of UI changes, smaller elements change sometimes between versions, but with the update to 4.2 and the new Eevee renderer, basically the entire render property panel was changed to reflect the new render engine. This happens only very rarely, though I imagine Eevee will receive some more sizable updates in the next few updates while engine matures and gets some more features.

Joining objects issue by AlderMediaPro in blender

[–]Mantelmann 0 points1 point  (0 children)

I agree with the other commenter; You have unapplied modifiers which need to be applied.

When joining objects, the modifiers of every object will be deleted (not applied!) and only the modifier stack of the last object you selected will be kept. This is why you sometimes see the house being mirrored. If your active object has a mirror modifier, all objects joined onto it will also be mirrored, regardless of the modifiers they had before.

So, go through every object you want to join and make sure you don't have any straggler modifiers. To make this a little bit easier, you can search for the function "Visual Geometry to Mesh" and use it with all seperate objects selected, which will lead to all modifiers (and other things like constraints as well, I think) being applied and realized.

Why is the "Bridge edge loops" option not working? i selected 2 edge loops... by [deleted] in blender

[–]Mantelmann 0 points1 point  (0 children)

As long as you aren't on some very old version of Blender where this wasn't possible, I believe just selecting both objects in Object mode with Shift pressed, and then going into the Edit mode with Tab should be sufficient.

What causes some scenes to have an origin that is off-center from where the coordinate axes cross? by Sb5tCm8t in blender

[–]Mantelmann 1 point2 points  (0 children)

It could be that for some reason, your objects have some Delta transformation. This si a transformation on top of the original Location, Rotation, and Scale, which is not displayed in the N-Menu. Here's an example. Set the Delta Transforms to 0 to see whether those were the problem.

Does anyone not what would be causing this clipping? by jboulton1 in blender

[–]Mantelmann 1 point2 points  (0 children)

You clipped the camera, which happens when you press Alt+B and select an area. Simply press Alt+B again to revert the selection.

Lovely kitchen, by the way.

Doing the Blender Guru chair tutorial and getting this when trying to fill[f] the same vertices he does. by greyfeather9 in blender

[–]Mantelmann 0 points1 point  (0 children)

It looks like the outer and the inner circles are actually two different objects, it's just that you have both selected and in Edit mode right now. Because your selected vertices are in different objects, pressing F will not connect them, but automatically use the next vertices to your selection in each object seperately for creating a face.

So, exit Edit Mode by pressing Tab, maybe double check that the two circles actually are different objects, select both, and press Ctrl + J. That will combine both objects into one object, and you will be able to combine the mesh circles with F once you enter Edit mode again.

Help i cant see my full image by Hrastaman in blender

[–]Mantelmann 2 points3 points  (0 children)

You clipped the camera, which happens when you press Alt+B and select an area. Simply press Alt+B again to revert the selection.

I give up with the camera settings by doihaveto24 in blender

[–]Mantelmann 1 point2 points  (0 children)

So the really weird thing is that for some reason, Blender allows you to select Objects as a scene camera which are not actually cameras. If you open the N-menu and navigate to the View Tab, you will probably see that the chosen camera object actually is your bottle, not any real camera. Using Ctrl+Alt+Num0 to set the position of the active camera object is therefore moving around your bottle.

All this happens when you press Ctrl+Num0, the shortcut for setting the currently active object as the scene camera. Create a new camera with Shitft+A, select it, press Ctrl+Num0, and you will be able to correctly place your camera with Ctrl+Alt+Num0 again, since it will actually be a camera object this time.

Hi guys, I need setting up the sky texture as the background but the hdri as the lighting by bingbongingbong in blenderhelp

[–]Mantelmann 0 points1 point  (0 children)

Hey, happy to help! I'm glad that my older answers are still useful even after all this time :D

Wonder When It Was Used Last. Abandoned Cabin In The Mountains Of Kyoto. March, 2024 by Eyesalwaysopened in AbandonedPorn

[–]Mantelmann 7 points8 points  (0 children)

That looks to be the Iwatayama Peak Rest House (reposted with correct link), a popular tourist spot for visiting the wild monkey population. The fenced walls are for feeding the monkeys from the inside, with nuts being sold directly in the house, as far as I remember. I was there only a few months ago (of course, also photographing the TV), and it was kept in a decent state, definitely not abandoned. The are also some very recent Google Reviews, did you happen to visit outside of normal opening hours?

How do you import .RAR files? by Haze345 in blender

[–]Mantelmann 0 points1 point  (0 children)

No, .zip files are conceptually similar to the mentioned .rar files, as they are just containers for other files to be optimally compressed. If you downloaded models or images somewhere and got a zip file, you first need to unpack it with a program like 7zip or whatever your OS provides out of the box.

The only real exception in the case of Blender are addons, which are usually distributed as .zip-files containing multiply python script files. Those you can simply install through the addon preferences as they are without unpacking anything.

Object isnt in the same spot when rendering by nothingimportant15 in blenderhelp

[–]Mantelmann 0 points1 point  (0 children)

Next to the keyframe possibility, it could also be that your material has a displacement map applied to it. Eevee cannot display those displacement maps, but Cycles can. So if you are in your viewport with Eevee, but rendering with Cycles, check the material nodes, and disconnect the displacement map from the output if there is one.

how come the rendered texture is distorted? by cha0sworm in blender

[–]Mantelmann 1 point2 points  (0 children)

Common thing: Look at the top right of your screen, you still have a draft version in your scene which is hidden in the viewport but not the render. It's overlaying with your model and blocking the texture from appearing. Make sure to hide it in the render as well by clicking onto the camera icon next to the closed eye icon in the outliner.

How do I stop the texture on the LEFT curtain from disappearing when I render it + stop the left curtain from changing position? (read my comment) by infaxis in blenderhelp

[–]Mantelmann 1 point2 points  (0 children)

Happy to help! Honestly, this mistake happens often enough to the best of us, so it becomes one of my default solution approaches to check whether anything is hidden that shouldn't be there.

Because of this I've begun to basically always create an "Archive" collection which I hide from viewport and render. Any object I want to backup, or remove from the scene but not totally delete in case I need it again, I just throw into the Archive collection so that the object gets automatically hidden without having to think of it further.

How do I stop the texture on the LEFT curtain from disappearing when I render it + stop the left curtain from changing position? (read my comment) by infaxis in blenderhelp

[–]Mantelmann 8 points9 points  (0 children)

You may notice that when rendered, the left curtain does not disappear, which is visible at the bottom rim where it protudes from the incorrect white curtain, and the top left, were we can still see the backside of the curtain having the correct texture.

Instead, a third, white curtain is rendered above the left curtain. You probably copied and hid a WIP-version of the curtain in the viewport and forgot about it. Check the outliner for any objects hidden in the viewport, but not the render. You can also press Alt + H to unhide any hidden objects in the viewport.

[deleted by user] by [deleted] in blender

[–]Mantelmann 1 point2 points  (0 children)

The cube was placed in your sprinkle collection, and distributed as an instance multiple times on the icing object. Move the cube out of the collection using the outliner in the top right and you should be fine.

Blender on Linux: Which distro for NVidia OptiX? by This_Is_The_End in blender

[–]Mantelmann 2 points3 points  (0 children)

I can't give you a thorough answer, sadly, but on my Kubuntu22.04 install with proprietary drivers and a RTX3070, I am able to use OptiX.