Shader tests

General questions about Indigo, the scene format, rendering etc...
User avatar
pixie
Indigo 100
Posts: 2345
Joined: Sat Dec 29, 2007 4:54 am
Location: Away from paradise
3D Software: Cinema 4D
Contact:

Post by pixie » Mon Sep 22, 2008 2:04 am

@hans:
psst! it's all fake nonetheless ;)

User avatar
Hans
Posts: 14
Joined: Thu Jan 11, 2007 3:58 am
Location: Japan
Contact:

Post by Hans » Mon Sep 22, 2008 11:34 pm

Kram1032:
Oh, thanks. Your mention made it very easy for me to understand what the shaders is like and how I can use it.

pixie:
:D

User avatar
Kram1032
Posts: 6649
Joined: Tue Jan 23, 2007 3:55 am
Location: Austria near Vienna

Post by Kram1032 » Tue Sep 23, 2008 3:05 am

No problem.
Btw, the "procedural bump test"-scene show an example for an even more complex procedural map, which looks more realistic, as it doesn't use full circles but random lines... (based on a Brownian noise pattern, pulled to thin grooves...)

User avatar
cpfresh
Posts: 501
Joined: Thu Jun 14, 2007 12:20 pm
Location: California, USA
Contact:

Post by cpfresh » Tue Sep 23, 2008 7:16 am

progress ... kind of? the grid is showing up but not exactly how i'd planned.
Attachments
im1222109942.png
the grid
im1222109942.png (263.85 KiB) Viewed 3098 times

User avatar
Kram1032
Posts: 6649
Joined: Tue Jan 23, 2007 3:55 am
Location: Austria near Vienna

Post by Kram1032 » Tue Sep 23, 2008 7:20 am

how did you plan it?

crojack
Posts: 396
Joined: Tue Dec 04, 2007 1:48 pm
Location: Portland, Oregon
Contact:

Post by crojack » Tue Sep 23, 2008 7:49 am

cpfresh wrote:progress ... kind of? the grid is showing up but not exactly how i'd planned.
might not be as planned, but really cool looking nonetheless!

User avatar
cpfresh
Posts: 501
Joined: Thu Jun 14, 2007 12:20 pm
Location: California, USA
Contact:

Post by cpfresh » Tue Sep 23, 2008 8:28 am

lol thanks crojack. :)

mark: the plan was a black grid on white but i think it's safe to say that i've got the colors quite mixed-up.

back to the drawing board?

User avatar
Kram1032
Posts: 6649
Joined: Tue Jan 23, 2007 3:55 am
Location: Austria near Vienna

Post by Kram1032 » Tue Sep 23, 2008 8:35 am

just to the colour-part of the drawing board ;)
Well, Just as crojack, I like it as is ^^
If you change it a bit to be yellow everywhere, it could be the perfect Holoroom^^

crojack
Posts: 396
Joined: Tue Dec 04, 2007 1:48 pm
Location: Portland, Oregon
Contact:

Post by crojack » Tue Sep 23, 2008 8:43 am

cpfresh: are you writing this code into skindigo or are you editing the actual text file?

User avatar
cpfresh
Posts: 501
Joined: Thu Jun 14, 2007 12:20 pm
Location: California, USA
Contact:

Post by cpfresh » Tue Sep 23, 2008 9:16 am

crojack:
since there is currently no shader support in SkIndigo for the albedo property, i have been using the "linked igm" material type and editing the code in an igm file. i got the idea after using fused's checkerboard shader since it was the easiest way to get the code into the albedo entry in sketchy.

mark:
holoroom? /me runs off to google :)

User avatar
PureSpider
Posts: 1459
Joined: Tue Apr 08, 2008 9:37 am
Location: Karlsruhe, BW, Germany
Contact:

Post by PureSpider » Tue Sep 23, 2008 9:35 am

Reminds me of Tron :D

crojack
Posts: 396
Joined: Tue Dec 04, 2007 1:48 pm
Location: Portland, Oregon
Contact:

Post by crojack » Tue Sep 23, 2008 9:40 am

I was thinking Tron also!

I just tried the linked IGM with the checkerboard, same as you, but no luck. I get an error asking for element shader or something like that.

User avatar
cpfresh
Posts: 501
Joined: Thu Jun 14, 2007 12:20 pm
Location: California, USA
Contact:

Post by cpfresh » Tue Sep 23, 2008 10:26 am

crojack:
i forgot to mention you'll need to add another set of <shader> and </shader for the checkboard to work. sorry.

as far as further progress goes, ... peep the grid:
Attachments
im1222125730.png
the other side ... not so much
im1222125730.png (316.21 KiB) Viewed 3043 times
im1222125104.png
cool on one side
im1222125104.png (786.97 KiB) Viewed 3044 times

User avatar
cpfresh
Posts: 501
Joined: Thu Jun 14, 2007 12:20 pm
Location: California, USA
Contact:

Post by cpfresh » Tue Sep 23, 2008 7:05 pm

ok well i think im stuck on this shader as i cant seem to get the courses to alternate the offset. my code is below. the problem lies in not being able to use the odd() function as given by Ono. i'm using reals and the function wants ints. i tried a work around for this but never-the-less it remains in grid form and not a CMU pattern as i'd hoped. any comments or solutions are welcome. thanks

Code: Select all

            <albedo>
                <shader>
                    <shader>
                        <![CDATA[

                        def eval(vec3 pos) vec3 : 
                        vec3(
                             # this first if is to determine whether
                             # this is an odd or even course
                            if(
                                eq(
                                    mod( 
                                        sub(
                                            div(
                                                dotj(
                                                    getTexCoords(0)
                                                ),64.0
                                            ),
                                            mod(
                                                dotj(
                                                    getTexCoords(0)
                                                ),64.0
                                            )
                                         ),2.0
                                    ),0.0
                                ),

                                #this is one course configuration
                                if(
                                    and(
                                        gte(
                                            mod(
                                                doti(
                                                    getTexCoords(0)
                                                ),128.0
                                            ),
                                            div(
                                                125.0,128.0
                                            )
                                        ),
                                        gte(
                                            mod(
                                                dotj(
                                                    getTexCoords(0)
                                                ),64.0
                                            ),
                                            div(
                                                61.0,64.0
                                            )
                                        )
                                    ),1.0,0.0
                                ),

                                # this is the other course configuration
                                if(
                                    and(
                                        gte(
                                            mod(
                                                add(
                                                    doti(
                                                        getTexCoords(0)
                                                    ),64.0
                                                ),128.0
                                            ),
                                            div(
                                                125.0,128.0
                                            )
                                        ),	
                                        gte(
                                            mod(
                                                dotj(
                                                    getTexCoords(0)
                                                ),64.0
                                            ),
                                            div(
                                                61.0,63.0
                                            )
                                        )
                                    ),1.0,0.0
                                )
                            )
                        )
                      ]]>
                    </shader>
               </shader>
i've used the 64 (8x8) and 128 (16x8) as the dimensions of my cmu blocks -- broken down into 1/8ths of an inch. i did this so the lines would be the width of the mortar joint (3/8")

User avatar
Kram1032
Posts: 6649
Joined: Tue Jan 23, 2007 3:55 am
Location: Austria near Vienna

Post by Kram1032 » Wed Sep 24, 2008 1:30 am

Sorry, meant "holodeck" I didn't know, it's "deck" in english, too, so I hoped I'd hit the word with "room"^^
http://en.wikipedia.org/wiki/Holodeck

to get ints from reals, use floor(real+0,5) ;) (or alternatively, ceil(real-0,5))

I wish I could see this with simple calc-signs.... As it is here, it looks pretty confusing, somehow....

Post Reply
223 posts

Who is online

Users browsing this forum: No registered users and 1 guest