0 votes

In order for me to practice maths, and programming, last summer I made (with the help of the community) a program that makes animations using mathematical objects named epicycloid curves. You can find the program's trailer on youtube typing "epikiklos trailer" and it will be posted by me Emanuel Hongu if you wanna see it.

Since then I also used some other programs by other people, and seen LOTS of really really amazing and beautiful things made with programming. They are things that I really don't know how to explain in a single sentence or even a paragraph but long story short, they are programs that do visually appealing stuff.

And I like them. Especially my favourite one; Fragments of Euclid by NuSan, a game that tries to put the non euclidean geometry of Escher's art into a 3D game, and does it really amazingly well. I would even say in that game you travel through the fourth dimension. At least I absolutely felt like a planeswalker while playing it. I like it so much I even wanna make my own version of it with lots of additions. Seriously just play it, it's free and great.

So during this year I started developing a taste for visually appealing software, something like artistic programming, where maths and visual beauty are one.

Thus I decided to start making this kinds of programs. And now I wanna make a program that draws fractals. In theory I would want it to draw any Mandelbrot's Set, but I will begin with the one that we know the most; z = z^2 + c.
I really think I already know the logic to it and how to do it, I just don't know the syntax of Godot, and I really wanna learn it cause I think Godot is just great and wanna use it.
The first thing I need to know is how to draw a black dot on whatever spot on the screen. I would want that dot to be one pixel wide, so that I can get the best resolution for my fractals, as I wanna change the color of every single pixel on the screen, one by one. (Maybe my PC won't be able to handle that but I wanna at least try it)

So to summarize, my question is; how can I draw a dot on the screen of a specific color? I can use any color format and any syntax as long as it works.

And lastly, cause my mind just flies unconrolably I need to tell you about some future projects related to fractals. As I said I want this program to be able to draw any exponent of Mandeltrot's set. But this is not all. I've seen that the julia set is kinda like a radiography where you can see like layers of an object that's been scanned. I thought I could try to put infinitely many of these (not really) two dimensional layers on top of each other and try to make a 3D julia set showing it's evolution. That would probably look cool.
And of course, the relation between Mandelbrot and Julia set can be represented in (kinda) three dimensions too and I say it would look rather cool, too.

Thank you in advance.

Edit: I used draw_polyline and it works only if the three points of the triangle are in different positions, it the three points I give are in the same position it doesn't draw anything. I'm thinking I could use draw_line and just use two points. Maybe that works for a line of length one pixel.

Edit2: draw_line works for this. If pos_from and pos_to are one pixel apart it draws what looks to me like a dot. Problem is I don't really know if that is really a one pixel length dot or is it a two pixel length line (two pixels of length, pixel of pos_from and of pos_to).
Cause I'm not sure but maybe this will mess with my maths later on.

I'm gonna go sleep now, I will reply tomorrow.

in Engine by (67 points)
edited by

oooh great! I've always been using Node2Ds and got bored of just using that (and using the nodes necesary to make GUIs, you know labels buttons and so)
Time to practice! I don't wanna keep being a noob, so I need to learn new things. Thx for the links, I'll see what I can do

Okay, so I'm already tinkering with it. I will ask you a question later, now I need to go. thx for everything!

Okay so before I went out I created a ColorRect into the scene, gave it a ShaderMaterial as shown in the link, pasted the shader and it didn't do anything. Just a white window. So what I did was read again this page and created a TextureRectwith the one dimensional texture they give (called pal.png) as texture. Then I gave every variable in the shader a value such as 1.0 for the scale, 10 for iter, vec2(0,0) for the center etc just to see if it did anything. But it didn't do, nor error nor drawing anything so clearly I'm missing something.

Only thing I didn't do is give tex a value. I guess maybe that's the problem, it's just that I don't know how to give it a value. I tried uniform sampler2D tex = "res://pal.png"; and that didn't work cause it didn't recognise the " symbol, tried without them and didn't recognize identifier "res"

So, my question is, what is this suposed to do if I did it right? This being creating a ColorRect and giving it a ShaderMaterial and pasting the code above.

I feel quite useless now xd god I swear I'll become the best!

I tried uniform sampler2D tex = "res://pal.png"; and that didn't work

You can't give a sampler2D uniform a default value in the shader. You have to put it in as a uniform while editing the ShaderMaterial.

Sir, thou art a wizard. I shalt learn your black magic and become the next dark lord (You'r a genius to me at least and I will reverse egnineer this shader so that I can do many kool stuffs and I love you and I owe you my soul aka it worked and I'm a noob)

Haha ok.
Next time you have a question here, I'll start a discussion at Godot Dev forums. Looks like a better place to talk at.

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.