Discuss Scratch

Frisk-256
Scratcher
70 posts

SUPER Efficient 3D rendering!

It is possible to render high detail 3D fractals in scratch with an implementation of ray marching/sphere tracing, if you do not know what that is, here is a video explaining it
https://www.youtube.com/watch?v=svLzmFuSBhk
It can be implemented in scratch and can make amazing results, the basic idea can be summed up by this pseudocode
for each pixel:: hat control
set [ray pos v] to (camera location)
set [ray direction v] to (pixel location)
set [Iteration v] to (0)
rotate [ray direction v] by (camera rotation):: motion
repeat until <<ray escapes::sensing> or <(distance estimator)<(lower threshold)> or <(iteration)>(max iterations)>::operators>
Set [distance estimator v] to (distance to scene::sensing)
change [ray pos v] by ((ray direction) * (distance estimator))
change [iteration v] by (1)
end
if <<ray escaped::sensing> or <(iteration)>(max iterations)>::operators> then
set [pixel color v] to (object color at [ray pos v]::sensing)::pen
else
set [pixel color v] to (background color at [ray direction v]::sensing)::pen
end
I have 2 projects that implement this method to make 3D fractals, here are the links
https://scratch.mit.edu/projects/878955175/
https://scratch.mit.edu/projects/883814808/
This method is very powerful, and if you use it, please give me credit for it, have fun!
DifferentDance8
Scratcher
1000+ posts

SUPER Efficient 3D rendering!


Really cool actually, I have no idea why this isn't talked about more.
meunspeakable
Scratcher
100+ posts

SUPER Efficient 3D rendering!

DifferentDance8 wrote:

Really cool actually, I have no idea why this isn't talked about more.
Because it has very limited uses. It is only usable on simple geometries such as cubes, spheres, capsules, ect. More complex scenes can't be rendered at comparable speeds, excluding fractals or other repeating patterns.
__Falcon-Games__
Scratcher
1000+ posts

SUPER Efficient 3D rendering!

meunspeakable wrote:

DifferentDance8 wrote:

Really cool actually, I have no idea why this isn't talked about more.
Because it has very limited uses. It is only usable on simple geometries such as cubes, spheres, capsules, ect. More complex scenes can't be rendered at comparable speeds, excluding fractals or other repeating patterns.
Turbowarp raises it's hand…
meunspeakable
Scratcher
100+ posts

SUPER Efficient 3D rendering!

__Falcon-Games__ wrote:

meunspeakable wrote:

DifferentDance8 wrote:

Really cool actually, I have no idea why this isn't talked about more.
Because it has very limited uses. It is only usable on simple geometries such as cubes, spheres, capsules, ect. More complex scenes can't be rendered at comparable speeds, excluding fractals or other repeating patterns.
Turbowarp raises it's hand…
My point still stands.
Frisk-256
Scratcher
70 posts

SUPER Efficient 3D rendering!

meunspeakable wrote:

DifferentDance8 wrote:

Really cool actually, I have no idea why this isn't talked about more.
Because it has very limited uses. It is only usable on simple geometries such as cubes, spheres, capsules, ect. More complex scenes can't be rendered at comparable speeds, excluding fractals or other repeating patterns.
Griffpatch could only do about 7 spheres. I can do trillions, I wonder what he could do given this method.
Steve0Greatness
Scratcher
1000+ posts

SUPER Efficient 3D rendering!

Frisk-256 wrote:

Griffpatch could only do about 7 spheres. I can do trillions, I wonder what he could do given this method.
IDK, remake Quake?
Frisk-256
Scratcher
70 posts

SUPER Efficient 3D rendering!

Steve0Greatness wrote:

Frisk-256 wrote:

Griffpatch could only do about 7 spheres. I can do trillions, I wonder what he could do given this method.
IDK, remake Quake?
is it spelled Opac3tyD?
Steve0Greatness
Scratcher
1000+ posts

SUPER Efficient 3D rendering!

Frisk-256 wrote:

so is anyone going to talk about how groundbreaking this is?
How groundbreaking what is? This quote spam, or the efficient 3D rendering?
NFlex23
Scratcher
1000+ posts

SUPER Efficient 3D rendering!

Forgive my ignorance, but how is this any different from a renderer like this, for example: https://scratch.mit.edu/projects/532971692/
Yours does not seem any faster than a normal 3D renderer, in fact it is very slow at higher resolutions, especially when not using TurboWarp.
meunspeakable
Scratcher
100+ posts

SUPER Efficient 3D rendering!

NFlex23 wrote:

Forgive my ignorance, but how is this any different from a renderer like this, for example: https://scratch.mit.edu/projects/532971692/
Yours does not seem any faster than a normal 3D renderer, in fact it is very slow at higher resolutions, especially when not using TurboWarp.
I believe the OP was showing the potential of raymarching, especially for fractals. This is the same technique used in your project. It is slower than a normal 3d raycaster, but not for fractals and the like.
-B0NEKING999-
Scratcher
27 posts

SUPER Efficient 3D rendering!

i have no clue why im here i am garbage at coding
Frisk-256
Scratcher
70 posts

SUPER Efficient 3D rendering!

(excess characters removed by moderator - please don't spam)

Steve0Greatness wrote:

Frisk-256 wrote:

so is anyone going to talk about how groundbreaking this is?
How groundbreaking what is? This quote spam, or the efficient 3D rendering?
The 3D rendering

Last edited by Paddle2See (Oct. 10, 2023 20:13:24)

-B0NEKING999-
Scratcher
27 posts

SUPER Efficient 3D rendering!

i feel like this whole thing has turned into frisk arguing that he can make a better 3D engine and everyone just saying “nah bro”
meunspeakable
Scratcher
100+ posts

SUPER Efficient 3D rendering!

-B0NEKING999- wrote:

i feel like this whole thing has turned into frisk arguing that he can make a better 3D engine and everyone just saying “nah bro”
I have no doubt that he can make an amazing raymarching engine, but It's not applicable to much other than fractals and infinite repeating patterns(Or if you want soft shadows easily). Raycasting or Rasterizing is faster for most things, such as 3d games.

Frisk-256 wrote:

meunspeakable wrote:

DifferentDance8 wrote:

Really cool actually, I have no idea why this isn't talked about more.
Because it has very limited uses. It is only usable on simple geometries such as cubes, spheres, capsules, ect. More complex scenes can't be rendered at comparable speeds, excluding fractals or other repeating patterns.
Griffpatch could only do about 7 spheres. I can do trillions, I wonder what he could do given this method.
You can't compare pathtracing(https://scratch.mit.edu/projects/425020125/):

with raymarching(https://scratch.mit.edu/projects/413215476/):

Even if you want to make raymarching look really realistic, it's going to be a whole lot slower than other methods(raytracing/pathtracing)
Frisk-256
Scratcher
70 posts

SUPER Efficient 3D rendering!

I actually just made a new project with Sphere tracing, here is the link, it is a 3D model of the earth and at lower resolutions, it can be real time even without turbowarp, here is the link!
https://scratch.mit.edu/projects/907862335/
Frisk-256
Scratcher
70 posts

SUPER Efficient 3D rendering!

I am not doing any more quoteception, because it is a bad idea

Powered by DjangoBB