3CuS Blackbook

Moderator: SecondMan

User avatar
Kristof
Fusionista
Posts: 617
Joined: Thu Aug 07, 2014 1:30 pm
Answers: 1
Been thanked: 25 times

3CuS Blackbook

#1

Post by Kristof » Fri Jan 04, 2019 1:39 am

It's a new year, so I thought I'd share my 3CuS experiments -- something I had planned on doing last April / May but BMD sucked all the fun out of it for me then. Picked up graffiti writing again in 2018, so I'm going with "blackbook" instead of "scrapbook". 3CuS is one of my favorite plugins for Fusion (the other one being Krokodove) that is being developed by Chad and has been a real eyeopener for me.

I hope this thread will inspire other people, so do share whatever it is you're working on.
Last edited by Kristof on Sun Aug 11, 2019 2:36 pm, edited 2 times in total.

User avatar
Kristof
Fusionista
Posts: 617
Joined: Thu Aug 07, 2014 1:30 pm
Answers: 1
Been thanked: 25 times

Warped 3D Simplex Noise

#2

Post by Kristof » Fri Jan 04, 2019 1:59 am

This one is an example of a 3D Simplex Noise layered 8 times (fBm) with some additional domain warping applied:

Image
Image

User avatar
Kristof
Fusionista
Posts: 617
Joined: Thu Aug 07, 2014 1:30 pm
Answers: 1
Been thanked: 25 times

Warped Ridge Pattern

#3

Post by Kristof » Fri Jan 04, 2019 2:32 am

Layered 3D Simplex Noise, ridge pattern with some additional domain warping applied:

Image
Image

User avatar
AndrewHazelden
Fusionator
Posts: 1534
Joined: Fri Apr 03, 2015 3:20 pm
Answers: 8
Location: West Dover, Nova Scotia, Canada
Been thanked: 100 times
Contact:

Re: My 3CuS Blackbook

#4

Post by AndrewHazelden » Fri Jan 04, 2019 3:02 am

Wow @Kristof. This is amazing stuff you are doing with CustomShader3D!

User avatar
Kristof
Fusionista
Posts: 617
Joined: Thu Aug 07, 2014 1:30 pm
Answers: 1
Been thanked: 25 times

Re: My 3CuS Blackbook

#5

Post by Kristof » Fri Jan 04, 2019 4:33 am

Thanks @AndrewHazelden. Am working on a 3D noise shader with a UI that exposes all sorts of options as its all about finding those "magic" numbers to create an interesting look. Everything works fine, but I need to decide if it makes sense to try and put everything in one tool with a lot of if statements etc.

Another one I prepared earlier, adding Chad's Brightness/ Contrast 3D to the network:

Image
Last edited by Kristof on Fri Jan 04, 2019 5:31 am, edited 1 time in total.

User avatar
AndrewHazelden
Fusionator
Posts: 1534
Joined: Fri Apr 03, 2015 3:20 pm
Answers: 8
Location: West Dover, Nova Scotia, Canada
Been thanked: 100 times
Contact:

Re: My 3CuS Blackbook

#6

Post by AndrewHazelden » Fri Jan 04, 2019 4:50 am

Have you thought about exposing 4D animation controls with a time parameter? It would be mind bending to see these types of textures evolve with keyframe animation. :)

Added in 1 minute 16 seconds:
I haven't really used Fusion's VolumeFog tool much on practical IRL work. Can CustomShader3D output be fed into it?

Added in 5 minutes 12 seconds:
Kristof wrote:
Fri Jan 04, 2019 1:58 am
something I had planned on doing last April / May but BMD sucked all the fun out of it for me then.

Oh. I know that feeling all too well myself. :oops:

User avatar
Kristof
Fusionista
Posts: 617
Joined: Thu Aug 07, 2014 1:30 pm
Answers: 1
Been thanked: 25 times

Re: My 3CuS Blackbook

#7

Post by Kristof » Fri Jan 04, 2019 5:25 am

I modify position over time in the shader itself (like most shaders on Shadertoy do), so these things swirl at a rate you can control and which is exposed as a user input. But is that the same as true 4D noise? So I guess I'm asking to be schooled in that domain. :)

Actually, I prefer using a 3CuS over the VlF node as I can now see the volume in the 3D viewport and fly through it. I just have an array of planes (slices) using a 3Dp to describe the volume -- that's pretty fast btw. I also tried it with a particle sim to be able to control the dynamics in that context but then you need to run it through a 3Rep which makes it much slower unfortunately. Being able to do all this in 3D is sooooo much fun!

Myeah, BMD... Oh well! Nice sig' btw :)

User avatar
AndrewHazelden
Fusionator
Posts: 1534
Joined: Fri Apr 03, 2015 3:20 pm
Answers: 8
Location: West Dover, Nova Scotia, Canada
Been thanked: 100 times
Contact:

Re: My 3CuS Blackbook

#8

Post by AndrewHazelden » Fri Jan 04, 2019 5:49 am

Kristof wrote:
Fri Jan 04, 2019 5:25 am
But is that the same as true 4D noise? So I guess I'm asking to be schooled in that domain. :)
On WSL, only @Chad would know the right answer to that one.

I'm still miles behind you on CustomShader3D. I haven't gotten back to improve my ShaderToy to cg language porting skills like you did in 2017.

User avatar
Kristof
Fusionista
Posts: 617
Joined: Thu Aug 07, 2014 1:30 pm
Answers: 1
Been thanked: 25 times

Warped 3D Value Noise

#9

Post by Kristof » Fri Jan 04, 2019 5:55 am

Going for extra weird, this time using a Value Noise:

Image

@AndrewHazelden Okay, I'll be sending you something to play with soon.

User avatar
AndrewHazelden
Fusionator
Posts: 1534
Joined: Fri Apr 03, 2015 3:20 pm
Answers: 8
Location: West Dover, Nova Scotia, Canada
Been thanked: 100 times
Contact:

Re: My 3CuS Blackbook

#10

Post by AndrewHazelden » Fri Jan 04, 2019 5:59 am

Neat. That last one "Warped 3D Value Noise" is is like an abstract oil painting!

User avatar
Chad
Fusionator
Posts: 1436
Joined: Fri Aug 08, 2014 1:11 pm
Been thanked: 18 times

Re: My 3CuS Blackbook

#11

Post by Chad » Fri Jan 04, 2019 7:15 am

You've checked out the compiled output, right? Tells you a lot about how the compiler is handling that shader. Like the "cost" of breaking up a huge shader into a bunch of little shaders (assuming the struct you're passing is enough) is surprisingly small.

Added in 13 minutes 41 seconds:
Kristof wrote:
Fri Jan 04, 2019 5:25 am
I modify position over time in the shader itself (like most shaders on Shadertoy do), so these things swirl at a rate you can control and which is exposed as a user input. But is that the same as true 4D noise? So I guess I'm asking to be schooled in that domain. :)
Many animated 2D noises are just 3D noises where the slice in the volume changes position. That way you don't have to figure out a continuous animation for noise, saving a bunch of instructions. A 4D noise just bypasses that handy hack and makes 3D noise that actually has animation. Usually a bit slower, but it is needed for actual 3D effects. You could have much higher dimensions, like the noise could change based on some texture map or based on curvature of the surface or whatever. But then you're doing full VFX shader look dev, which is kinda what 3CuS is for, so that's to be expected. :)
Kristof wrote:
Fri Jan 04, 2019 5:25 am
Actually, I prefer using a 3CuS over the VlF node as I can now see the volume in the 3D viewport and fly through it. I just have an array of planes (slices) using a 3Dp to describe the volume -- that's pretty fast btw.
I need to dig up the old volume planes tool we used. 3Dp doesn't make a mesh, it makes instances of the upstream scenes, so it's not as fast as it could be. A mesh that is "collapsed" is gobs faster at sorting and rendering. The tool has some other nifties, like making the texture coordinates for you for different spaces and texture scalings, including anistropic. It also had look up curve controlled plane spacing, so you could control where the planes were closer and thus better sampling. The spacing was baked into the vertex alpha, so the shader could scale the alpha for the planes based on how tightly they were packed. Oh, and there was a built in proxy so you could balance interactive performance with final render quality.

Unlike a raymarcher, the stack of planes (quad or hexagons or isosurface slices) just "works" for arbitrary Fusion scene graph mesh intersections, provided you brute force enough. It's a bit harder to do shadows though.

Added in 5 minutes 31 seconds:
AndrewHazelden wrote:
Fri Jan 04, 2019 4:56 am

I haven't really used Fusion's VolumeFog tool much on practical IRL work. Can CustomShader3D output be fed into it?
Almost. Fusion's VolumeFog doesn't have an input for 3D volumes (as it's own datatype) or quilt images with metadata. Fusion's SDK lets you add datatypes, so a bunch of tools at Anatomical used a 3D image datatype and passed that around in the connections. But we also could convert bidirectionally to a quilt with enough metadata to handle a bunch of corner conditions, like proxy, anisotropic scaling, anisotropic sampling, etc.

The thing with metadata is that the tools using it have to be on the same page. Fusion took some steps in that direction, like with color spaces and stereo parameters, but a lot more could be done.

Added in 1 minute 35 seconds:
Kristof, you can make macros that output from a 3Rn and make image noise generators this way, too. Kinda like Darktree under the hood if you wanted.

User avatar
Kristof
Fusionista
Posts: 617
Joined: Thu Aug 07, 2014 1:30 pm
Answers: 1
Been thanked: 25 times

Re: My 3CuS Blackbook

#12

Post by Kristof » Sat Jan 05, 2019 2:20 am

Hey @Chad, thanks for your detailed and informative response. I haven't looked at the compiled output yet, I'll look into it. Might get back to you on how to get that info, but I'll check the things you've shared in the past first. I still have a ton to learn, that's for sure.

Having bumped noise functions to 3D got me all excited, but I'll dig deeper and try to understand the benefits of a true 4D noise. :) Periodic noise is another field I want to explore more to get those tiles. The image noise generators you mentioned is something that got me started, so a macro does sound sweet.

Having played with instancing planes and seeing the possibilities of such a workflow, I have to say that your volume planes tool sure does sound super cool! I also appreciate how you share your deep knowledge on the matter. Is that planes tool something you might make available to the public?

User avatar
Kristof
Fusionista
Posts: 617
Joined: Thu Aug 07, 2014 1:30 pm
Answers: 1
Been thanked: 25 times

p6mm Hexagonal Symmetry

#13

Post by Kristof » Sun Jan 06, 2019 11:03 am

If you add this 3Cus node to your network and manipulate the position, you can get these kaleidoscope like images.

Spoiler
Show

Code: Select all

{
	Tools = ordered() {
		position = MtlChanBool {
			CtrlWZoom = false,
			NameSet = true,
			CustomData = {
				Settings = {
					[1] = {
						Tools = ordered() {
							position = MtlChanBool {
								CtrlWZoom = false,
								NameSet = true,
								CustomData = {
								},
								Inputs = {
									OperandAR = Input { Value = 19, },
									OperandAG = Input { Value = 20, },
									OperandAB = Input { Value = 21, },
									CoordSpace = Input { Value = FuID { "World" }, },
									MaterialID = Input { Value = 1, },
								},
								ViewInfo = OperatorInfo { Pos = { 1320, 49.5 } },
								Name = "position"
							}
						}
					},
					[2] = {
						Tools = ordered() {
							position = MtlChanBool {
								CtrlWZoom = false,
								NameSet = true,
								CustomData = {
								},
								Inputs = {
									OperandAR = Input { Value = 25, },
									OperandAG = Input { Value = 26, },
									OperandAB = Input { Value = 27, },
									CoordSpace = Input { Value = FuID { "Model" }, },
									MaterialID = Input { Value = 1, },
								},
								ViewInfo = OperatorInfo { Pos = { 1320, 49.5 } },
							}
						}
					},
				}
			},
			Inputs = {
				OperandAR = Input { Value = 19, },
				OperandAG = Input { Value = 20, },
				OperandAB = Input { Value = 21, },
				CoordSpace = Input { Value = FuID { "World" }, },
				MaterialID = Input { Value = 1, },
			},
			ViewInfo = OperatorInfo { Pos = { 1320, 49.5 } },
		},
		hexagonal_p6mm = Indicated.CustomShaderOperator3D {
			NameSet = true,
			CustomData = {
				Settings = {
				}
			},
			Inputs = {
				ShaderTextLabel = Input { Value = 0, },
				ShaderTextInputs = Input { Value = "FuFloat4 Position;\nfloat Repeat;\n\n", },
				ShaderTextBody = Input { Value = "#define SQ3 1.7320508076\n// https://www.shadertoy.com/view/XdVcRW\n\nfloat2x2 rot2d( float a )\n{\n    return float2x2 ( cos( a ) , -sin( a ) , sin( a ) , cos( a ) );\n}\n\nfloat2 p6mmmap( float2 uv , float repeats )\n{\n    // clamp to a repeating box width 6x height 2x*sqrt(3)\n    uv.x /= SQ3;\n    uv = fract( uv * repeats - 0.5 ) - 0.5;\n    uv.x *= SQ3;\n\n    uv = abs( uv );\n\n    float2 st = uv;\n\n    float2 uv330 = mul( rot2d( radians( 330.0 ) ) , uv );\n    if ( uv330.x < 0.0 )\n    {\n        st.y = ( st.y - 0.5 ) * -1.0;\n        st.x *= SQ3;\n        return st * 2.0;\n    }\n    else if ( uv330.x > 0.5 )\n    {\n        st.x = ( st.x - 0.5 * SQ3 ) * -1.0 * SQ3;\n        return st * 2.0;\n    }\n\n    float2 uv30 = mul( rot2d( radians( 30.0 ) ) , uv );\n    if ( uv30.y < 0.0 && uv30.x >= 0.5 )\n    {\n        st = float2( 1.0 , 1.0 );\n    }\n    else if ( uv30.y >= 0.0 && uv30.x >= 0.5 )\n    {\n        st = float2( -1.0 , 1.0 );\n    }\n    else if (uv30.y < 0.0 && uv30.x < 0.5)\n    {\n        st = float2( 1.0 , -1.0 );\n    }\n    else st = float2( -1.0 , -1.0 );\n\n    uv30.x = uv30.x - 0.5;\n    uv = mul( rot2d( radians( 270.0 ) ) , uv30 );\n    st = uv * st;\n    st.x *= SQ3;\n    return st * 2.0;\n}\n\nfloat4 Shade( inout FuFragment f )\n{\n    float3 position = Position.Shade(f).rgb;\n    return float4( p6mmmap( position.xy , Repeat ) , position.z , 1.0 );\n}", },
				MaterialGroup = Input { Value = 1, },
				FloatGroup = Input { Value = 1, },
				MaterialID = Input { Value = 10, },
				Position = Input {
					SourceOp = "position",
					Source = "MaterialOutput",
					CustomData = {
						Metadata = {
							Type = "Material",
							Set = "Position",
						}
					},
				},
				Repeat = Input {
					Value = 6,
					CustomData = {
						Metadata = {
							Type = "Float",
							Set = "Repeat",
						}
					},
				},
			},
			ViewInfo = OperatorInfo { Pos = { 1430, 49.5 } },
			UserControls = ordered() {
				Position = {
					{
						LINKID_DataType = "MtlGraph3D"
					},
					{
						LINKID_DataType = "Image"
					},
					{
						LINKID_AllowedDataType = "Image"
					},
					{
						LINKID_AllowedDataType = "Mask"
					},
					LINK_Main = 2,
					INP_AcceptsGLImages = true,
					INPID_InputControl = "ImageControl",
					IC_ControlPage = 0,
					INP_Required = false,
					INP_AcceptsMasks = true,
				},
				PositionLabel = {
					INPID_InputControl = "LabelControl",
					IC_ControlPage = 1,
					ICS_Name = "Position",
					ICD_Width = 0.9,
					INP_Passive = true,
					INP_External = false,
				},
				PositionDeleteButton = {
					LINKID_DataType = "Number",
					INPID_InputControl = "MultiButtonControl",
					INP_DoNotifyChanged = 1,
					MBTNC_AddButton = "X",
					MBTNC_Type = "Toggle",
					ICD_Width = 0.1,
					INP_External = 0,
					ICS_Name = "",
					IC_ControlPage = 1,
					MBTNC_ButtonHeight = 18,
				},
				Repeat = {
					IC_ControlPage = 0,
					LINKID_DataType = "Number",
					INPID_InputControl = "SliderControl",
				},
				RepeatLabel = {
					INPID_InputControl = "LabelControl",
					IC_ControlPage = 1,
					ICS_Name = "Repeat",
					ICD_Width = 0.9,
					INP_Passive = true,
					INP_External = false,
				},
				RepeatDeleteButton = {
					LINKID_DataType = "Number",
					INPID_InputControl = "MultiButtonControl",
					INP_DoNotifyChanged = 1,
					MBTNC_AddButton = "X",
					MBTNC_Type = "Toggle",
					ICD_Width = 0.1,
					INP_External = 0,
					ICS_Name = "",
					IC_ControlPage = 1,
					MBTNC_ButtonHeight = 18,
				}
			}
		},
		noise_cubist = Indicated.CustomShaderOperator3D {
			NameSet = true,
			CustomData = {
				Settings = {
				}
			},
			Inputs = {
				ShaderTextLabel = Input { Value = 0, },
				ShaderTextInputs = Input { Value = "FuFloat4 Position;\nfloat Scale;\n\n", },
				ShaderTextBody = Input { Value = "#define SCALE Scale\n#define MOD3 vec3( 0.1031 , 0.11369 , 0.13787 )\n\nvoid FAST32_hash_3D( 	vec3 gridcell,\n                        out vec4 lowz_hash_0,\n                        out vec4 lowz_hash_1,\n                        out vec4 lowz_hash_2,\n                        out vec4 lowz_hash_3,\n                        out vec4 highz_hash_0,\n                        out vec4 highz_hash_1,\n                        out vec4 highz_hash_2,\n                        out vec4 highz_hash_3	)		//	generates 4 random numbers for each of the 8 cell corners\n{\n    //    gridcell is assumed to be an integer coordinate\n\n    //	TODO: 	these constants need tweaked to find the best possible noise.\n    //			probably requires some kind of brute force computational searching or something....\n    const vec2 OFFSET = vec2( 50.0, 161.0 );\n    const float DOMAIN = 69.0;\n    const vec4 SOMELARGEFLOATS = vec4( 635.298681, 682.357502, 668.926525, 588.255119 );\n    const vec4 ZINC = vec4( 48.500388, 65.294118, 63.934599, 63.279683 );\n\n    //	truncate the domain\n    gridcell.xyz = gridcell.xyz - floor(gridcell.xyz * ( 1.0 / DOMAIN )) * DOMAIN;\n    vec3 gridcell_inc1 = step( gridcell, vec3( DOMAIN - 1.5 ) ) * ( gridcell + 1.0 );\n\n    //	calculate the noise\n    vec4 P = vec4( gridcell.xy, gridcell_inc1.xy ) + OFFSET.xyxy;\n    P *= P;\n    P = P.xzxz * P.yyww;\n    lowz_hash_3.xyzw = vec4( 1.0 / ( SOMELARGEFLOATS.xyzw + gridcell.zzzz * ZINC.xyzw ) );\n    highz_hash_3.xyzw = vec4( 1.0 / ( SOMELARGEFLOATS.xyzw + gridcell_inc1.zzzz * ZINC.xyzw ) );\n    lowz_hash_0 = fract( P * lowz_hash_3.xxxx );\n    highz_hash_0 = fract( P * highz_hash_3.xxxx );\n    lowz_hash_1 = fract( P * lowz_hash_3.yyyy );\n    highz_hash_1 = fract( P * highz_hash_3.yyyy );\n    lowz_hash_2 = fract( P * lowz_hash_3.zzzz );\n    highz_hash_2 = fract( P * highz_hash_3.zzzz );\n    lowz_hash_3 = fract( P * lowz_hash_3.wwww );\n    highz_hash_3 = fract( P * highz_hash_3.wwww );\n}\n\nvec3 Interpolation_C2( vec3 x )\n{\n    return x * x * x * (x * (x * 6.0 - 15.0) + 10.0);\n}\n\n//\n//	Cubist Noise 3D\n//	http://briansharpe.files.wordpress.com/2011/12/cubistsample.jpg\n//\n//	Generates a noise which resembles a cubist-style painting pattern.  Final Range 0.0->1.0\n//	NOTE:  contains discontinuities.  best used only for texturing.\n//	NOTE:  Any serious game implementation should hard-code these parameter values for efficiency.\n//\nfloat Cubist3D( vec3 P, vec2 range_clamp )	// range_clamp.x = low, range_clamp.y = 1.0/(high-low).  suggest value low=-2.0  high=1.0\n{\n    //	establish our grid cell and unit position\n    vec3 Pi = floor(P);\n    vec3 Pf = P - Pi;\n    vec3 Pf_min1 = Pf - 1.0;\n\n    //	calculate the hash.\n    //	( various hashing methods listed in order of speed )\n    vec4 hashx0, hashy0, hashz0, hash_value0, hashx1, hashy1, hashz1, hash_value1;\n    FAST32_hash_3D( Pi, hashx0, hashy0, hashz0, hash_value0, hashx1, hashy1, hashz1, hash_value1 );\n\n    //	calculate the gradients\n    vec4 grad_x0 = hashx0 - 0.49999;\n    vec4 grad_y0 = hashy0 - 0.49999;\n    vec4 grad_z0 = hashz0 - 0.49999;\n    vec4 grad_x1 = hashx1 - 0.49999;\n    vec4 grad_y1 = hashy1 - 0.49999;\n    vec4 grad_z1 = hashz1 - 0.49999;\n    vec4 grad_results_0 = inversesqrt( grad_x0 * grad_x0 + grad_y0 * grad_y0 + grad_z0 * grad_z0 ) * ( vec2( Pf.x, Pf_min1.x ).xyxy * grad_x0 + vec2( Pf.y, Pf_min1.y ).xxyy * grad_y0 + Pf.zzzz * grad_z0 );\n    vec4 grad_results_1 = inversesqrt( grad_x1 * grad_x1 + grad_y1 * grad_y1 + grad_z1 * grad_z1 ) * ( vec2( Pf.x, Pf_min1.x ).xyxy * grad_x1 + vec2( Pf.y, Pf_min1.y ).xxyy * grad_y1 + Pf_min1.zzzz * grad_z1 );\n\n    //	invert the gradient to convert from perlin to cubist\n    grad_results_0 = ( hash_value0 - 0.5 ) * ( 1.0 / grad_results_0 );\n    grad_results_1 = ( hash_value1 - 0.5 ) * ( 1.0 / grad_results_1 );\n\n    //	blend the gradients and return\n    vec3 blend = Interpolation_C2( Pf );\n    vec4 res0 = mix( grad_results_0, grad_results_1, blend.z );\n    vec4 blend2 = vec4( blend.xy, vec2( 1.0 - blend.xy ) );\n    float final = dot( res0, blend2.zxzx * blend2.wwyy );\n\n    //	the 1.0/grad calculation pushes the result to a possible to +-infinity.  Need to clamp to keep things sane\n    return clamp( ( final - range_clamp.x ) * range_clamp.y, 0.0, 1.0 );\n    //return smoothstep( 0.0, 1.0, ( final - range_clamp.x ) * range_clamp.y );		//	experiments.  smoothstep doesn't look as good, but does remove some discontinuities....\n}\n\nfloat noise_type( float3 p )\n{\n    return float4( float3( Cubist3D( p , float2( -2.0 , 1.0 ) ) ) , 1.0 );\n}\n\n// ========= Main ===========\n\nfloat4 Shade( inout FuFragment f )\n{\n    float3 position = Position.Shade(f).rgb * SCALE;\n    return float4( float3( noise_type( position ) ) , 1.0 );\n}", },
				RCGroup = Input { Value = 1, },
				MaterialGroup = Input { Value = 1, },
				FloatGroup = Input { Value = 1, },
				ColorGroup = Input { Value = 1, },
				MaterialID = Input { Value = 7, },
				Position = Input {
					SourceOp = "hexagonal_p6mm",
					Source = "MaterialOutput",
					CustomData = {
						Metadata = {
							Type = "Material",
							Set = "Position",
						}
					},
				},
				Scale = Input {
					Value = 5,
					CustomData = {
						Metadata = {
							Set = "Scale",
							Type = "Float",
						}
					},
				},
			},
			ViewInfo = OperatorInfo { Pos = { 1540, 49.5 } },
			UserControls = ordered() {
				Position = {
					{
						LINKID_DataType = "MtlGraph3D"
					},
					{
						LINKID_DataType = "Image"
					},
					{
						LINKID_AllowedDataType = "Image"
					},
					{
						LINKID_AllowedDataType = "Mask"
					},
					INP_AcceptsGLImages = true,
					LINK_Main = 1,
					INP_AcceptsMasks = true,
					INPID_InputControl = "ImageControl",
					INP_Required = false,
					IC_ControlPage = 0,
				},
				PositionLabel = {
					INPID_InputControl = "LabelControl",
					IC_ControlPage = 1,
					ICS_Name = "Position",
					ICD_Width = 0.9,
					INP_Passive = true,
					INP_External = false,
				},
				PositionDeleteButton = {
					LINKID_DataType = "Number",
					INPID_InputControl = "MultiButtonControl",
					INP_DoNotifyChanged = 1,
					MBTNC_AddButton = "X",
					MBTNC_Type = "Toggle",
					ICD_Width = 0.1,
					INP_External = 0,
					ICS_Name = "",
					IC_ControlPage = 1,
					MBTNC_ButtonHeight = 18,
				},
				Scale = {
					IC_ControlPage = 0,
					INPID_InputControl = "SliderControl",
					INP_Default = 1,
					LINKID_DataType = "Number",
				},
				ScaleLabel = {
					INPID_InputControl = "LabelControl",
					IC_ControlPage = 1,
					ICS_Name = "Scale",
					ICD_Width = 0.9,
					INP_Passive = true,
					INP_External = false,
				},
				ScaleDeleteButton = {
					LINKID_DataType = "Number",
					INPID_InputControl = "MultiButtonControl",
					INP_DoNotifyChanged = 1,
					MBTNC_AddButton = "X",
					MBTNC_Type = "Toggle",
					ICD_Width = 0.1,
					INP_External = 0,
					ICS_Name = "",
					IC_ControlPage = 1,
					MBTNC_ButtonHeight = 18,
				}
			}
		},
		plane = Shape3D {
			NameSet = true,
			Inputs = {
				["SurfaceTorusInputs.ObjectID.ObjectID"] = Input { Value = 7, },
				["SurfaceSphereInputs.Visibility.Nest"] = Input { Value = 1, },
				["SurfaceIcoInputs.ObjectID.ObjectID"] = Input { Value = 8, },
				["SurfaceCylinderInputs.ObjectID.ObjectID"] = Input { Value = 5, },
				["SurfaceSphereInputs.Visibility.CullFrontFace"] = Input { Value = 1, },
				["SurfaceConeInputs.ObjectID.ObjectID"] = Input { Value = 6, },
				["SurfaceCubeInputs.ObjectID.ObjectID"] = Input { Value = 9, },
				["SurfaceSphereInputs.ObjectID.ObjectID"] = Input { Value = 3, },
				MaterialInput = Input {
					SourceOp = "noise_cubist",
					Source = "MaterialOutput",
				},
				["MtlStdInputs.MaterialID"] = Input { Value = 5, },
				["SurfacePlaneInputs.ObjectID.ObjectID"] = Input { Value = 1, }
			},
			ViewInfo = OperatorInfo { Pos = { 1540, 82.5 } },
		},
		pattern_out = BrightnessContrast {
			NameSet = true,
			Inputs = {
				Input = Input {
					SourceOp = "scale",
					Source = "Output",
				},
			},
			ViewInfo = OperatorInfo { Pos = { 1925, 82.5 } },
		},
		scale = Scale {
			NameSet = true,
			Inputs = {
				XSize = Input { Value = 0.5, },
				PixelAspect = Input { Value = { 1, 1 }, },
				FilterMethod = Input { Value = 9, },
				Input = Input {
					SourceOp = "renderer_uv",
					Source = "Output",
				},
			},
			ViewInfo = OperatorInfo { Pos = { 1760, 82.5 } },
		},
		renderer_uv = Renderer3D {
			NameSet = true,
			CustomData = {
				ToolVersion = 2,
			},
			Inputs = {
				GlobalIn = Input { Value = 1001, },
				GlobalOut = Input { Value = 2001, },
				Width = Input { Value = 2048, },
				Height = Input { Value = 2048, },
				Depth = Input { Value = 4, },
				["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
				SceneInput = Input {
					SourceOp = "plane",
					Source = "Output",
				},
				RendererType = Input { Value = FuID { "RendererOpenGLUV" }, },
				["RendererOpenGLUV.Texturing"] = Input { Value = 1, },
				["RendererOpenGLUV.TextureDepth"] = Input { Value = 4, },
			},
			ViewInfo = OperatorInfo { Pos = { 1650, 82.5 } },
		}
	}
}

Image
Last edited by Kristof on Mon Jan 07, 2019 12:53 am, edited 2 times in total.

User avatar
SirEdric
Fusionator
Posts: 2059
Joined: Tue Aug 05, 2014 10:04 am
Answers: 4
Real name: Eric Westphal
Been thanked: 161 times
Contact:

Re: My 3CuS Blackbook

#14

Post by SirEdric » Sun Jan 06, 2019 12:07 pm

Nice!
But what sort of Input does the position require?

User avatar
Kristof
Fusionista
Posts: 617
Joined: Thu Aug 07, 2014 1:30 pm
Answers: 1
Been thanked: 25 times

Re: My 3CuS Blackbook

#15

Post by Kristof » Sun Jan 06, 2019 1:57 pm

Errrm, good catch @SirEdric! I tend to use a 3Bol to shuffle whatever it is that I need to RGB and feed that into my shader and work on those channels. Makes it more convenient to switch to different coordinate spaces or to UV instead of World Position for instance through presets.

I updated the code I shared earlier and added the input. Of course your shader's code would need to be modified to use that warped position. So in my case I have it connected to another shader that does the domain warping and fBm shizzle based on that modified position. So some code tweaking might me required, depending on your setup. Hope that clears it up.

Hmmm, need to look into that code some more as it doesn't give me a hexagon. The original shader is operating on UVs, so I would need to go through the math to see what needs tweaking. I was just happy to see some mirroring action :)
Last edited by Kristof on Mon Jan 07, 2019 1:02 am, edited 1 time in total.