General questions about Indigo, the scene format, rendering etc...
14 posts • Page 1 of 1
OnoSendai
Posts: 6174
Joined: Sat May 20, 2006 6:16 pm
Location: Newcastle upon Tyne, UK
Contact:

Hi Everyone,
for a bit of fun, I implemented rendering of the Mandelbrot set in ISL.

The material with shader is as follows:

Code: Select all

``````<material>
<name>mat1</name>
<diffuse>

<albedo>
<![CDATA[
# x^2 = (a + bi)^2 = aa + 2abi + bbii
# = a^2 + 2abi -b^2
# = a^2-b^2 + 2abi

# Does one iteration (application of f)
# Returns (re(x), im(x), i)
# Where i is the number of iterations before the point escaped.
def f(vec3 x, vec2 c) vec3 :
vec3(
e0(x)*e0(x) - e1(x)*e1(x) + e0(c),
2.0*e0(x)*e1(x) + e1(c),
if((e0(x)*e0(x) + e1(x)*e1(x)) < 2.0, e2(x) + 1.0, e2(x))
)

# The composition of f with itself.  Does 2 iterations.
# ISL doesn't support recursion for various reasons,
# so we'll use the following composition technique for bounded 'recursion'.
def f2(vec3 x, vec2 c) vec3:
f(f(x, c), c)

# Does 4 iterations
def f4(vec3 x, vec2 c) vec3:
f2(f2(x, c), c)

# etc..
def f8(vec3 x, vec2 c) vec3:
f4(f4(x, c), c)

def f16(vec3 x, vec2 c) vec3:
f8(f8(x, c), c)

def f32(vec3 x, vec2 c) vec3:
f16(f16(x, c), c)

def f64(vec3 x, vec2 c) vec3:
f32(f32(x, c), c)

def f128(vec3 x, vec2 c) vec3:
f64(f64(x, c), c)

def colour(real i) vec3:
vec3(i * 0.02, i * 0.04, i * 0.08)

def eval(vec3 pos) vec3 :
# We will use the texture coordinates for c.
# Return a colour based on the number of iterations before escape,
# which is in the third vector component of the returned vector, hence the e2()
# We call f128 to do 128 iterations.
colour(e2(f128(vec3(0.0,0.0,0.0), getTexCoords(0))))
]]>
</albedo>
</diffuse>
</material>
``````
Attachments

fused
Posts: 3552
Joined: Fri Sep 22, 2006 7:19 am
Location: Berlin, Germany
3D Software: Cinema 4D

nooooooooooooooooooooooooooooooooooooooooooooooo!

zeitmeister
Posts: 1996
Joined: Tue Apr 22, 2008 4:11 am
Location: Limburg/Lahn, Germany
Contact:

Hehe!
Cheers, David

DAVIDGUDELIUS // 3D.PORTFOLIO
·
Indigo 4.2.23 | Indigo for C4D 4.2.22 | C4D R14.042 | Mac OS X 10.13.6 | Windows 10 Professional x64

lycium
Posts: 1193
Joined: Wed Sep 12, 2007 7:46 am
Location: Leipzig, Germany
Contact:

nicely done mr chapman! i am ashamed you beat me to it

StompinTom
Posts: 1819
Joined: Mon Sep 04, 2006 3:33 pm

lycium wrote:nicely done mr chapman! i am ashamed you beat me to it
http://en.wikipedia.org/wiki/Seppuku

Posts: 2149
Joined: Mon Jun 16, 2008 10:48 am

lycium wrote:nicely done mr chapman! i am ashamed you beat me to it
I guess his edumaction paid off
benn hired a mercenary to kill my sig...

CTZn
Posts: 7240
Joined: Thu Nov 16, 2006 4:34 pm
Location: Paris, France

Hey StompinTom, it seems like there was a challenge between the guys but I don't think that seppuku was involved.

lol though
obsolete asset

galinette
Posts: 923
Joined: Sat Jan 09, 2010 1:39 am
Location: Nantes, France
Contact:

Eclat-Digital Research
http://www.eclat-digital.com

OnoSendai
Posts: 6174
Joined: Sat May 20, 2006 6:16 pm
Location: Newcastle upon Tyne, UK
Contact:

galinette wrote:Hey, not fair! Please advise when starting that kind of contest
Will do for next one

Godzilla
Posts: 985
Joined: Sat Jun 06, 2009 11:33 am

I was bored, so..

Click the image for a larger version, or go here for the 'Holy shit thats huge' version.

Largest image done in Indigo?
samlavoie.xyz

StompinTom
Posts: 1819
Joined: Mon Sep 04, 2006 3:33 pm

Godzilla wrote:I was bored, so..

Click the image for a larger version, or go here for the 'Holy shit thats huge' version.

Largest image done in Indigo?
Geez, you couldn't have gotten rid of all the noise? I think that's begging for a challenge... How much RAM did that eat up?

Godzilla
Posts: 985
Joined: Sat Jun 06, 2009 11:33 am

About 6.5GB of RAM @ 1 Super Samples
samlavoie.xyz

pixie
Posts: 2191
Joined: Sat Dec 29, 2007 4:54 am
Contact:

Godzilla wrote:About 6.5GB of RAM @ 1 Super Samples
I wonder how much memory if you had used indigo_console

arc en ciel
Posts: 138
Joined: Tue Apr 12, 2016 2:33 am