Shader tests
- Borgleader
- Posts: 2149
- Joined: Mon Jun 16, 2008 10:48 am
I'm not exactly sure what you mean by "map" the fbm, but I will take a stab at it.Borgleader wrote: And...how do you....map a procedural? I mean, in the 3d editor, how do you map the fbm?

Last edited by Grimm on Tue Jul 29, 2008 11:58 am, edited 1 time in total.
Grimm
that brushed look is very nice ono
I think I will build that shader and vector direction into the specular reflectivity exporter settings just for that - very handy for Solidworks materials...
the previous egg shell/dimpled look is nice too - might borrow that as well
keep the examples coming
EDIT:ok done that now when is 1.1.8 coming so I can try it?
I think I will build that shader and vector direction into the specular reflectivity exporter settings just for that - very handy for Solidworks materials...
the previous egg shell/dimpled look is nice too - might borrow that as well
keep the examples coming

EDIT:ok done that now when is 1.1.8 coming so I can try it?

its my one complaint, but its okay, i made my own*OnoSendai wrote:That's what you get for using a language without operator overloading (Java)eman7613 wrote:i do belive the syntax would benifit greatly from operators![]()
for anyone used to coding in java's horrid bigdecimal *raises hand*, this looks very familure
*j/k its just a math parser
Yes i know, my spelling sucks
ok,,, its hard to compete with such impressive shaders,,,
here are two very simple (you see, very very simple) gradient shaders, hope someone will find them useful:
thnaks to zomb for rendering!
here are two very simple (you see, very very simple) gradient shaders, hope someone will find them useful:
Code: Select all
<albedo>
<shader>
<shader>
<![CDATA[
# 2D gradient shader U
def eval(vec3 pos) vec3 :
vec3(
doti(getTexCoords(0))
)
]]>
</shader>
</shader>
</albedo>
<albedo>
<shader>
<shader>
<![CDATA[
# 2D gradient shader V
def eval(vec3 pos) vec3 :
vec3(
dotj(getTexCoords(0))
)
]]>
</shader>
</shader>
</albedo>
- Attachments
-
- 1.png (806.07 KiB) Viewed 3172 times
-
- 2.png (847.83 KiB) Viewed 3172 times
Last edited by fused on Tue Aug 12, 2008 6:57 pm, edited 1 time in total.
3d gradient in z direction this time. a tiny bit more complex.
guess this can be quite useful
again, thanks to zomb for rendering.
guess this can be quite useful

Code: Select all
<albedo>
<shader>
<shader>
<![CDATA[
# 3D gradient shader Z (up)
def eval(vec3 pos) vec3 :
vec3(
div(mod(dotk(pos),0.6),0.6)
)
]]>
</shader>
</shader>
</albedo>
<albedo>
<shader>
<shader>
<![CDATA[
# 3D gradient shader Z (up) with center = 0.5
def eval(vec3 pos) vec3 :
vec3(
div(mod(add(dotk(pos),div(0.6,2.0)),0.6),0.6)
)
]]>
</shader>
</shader>
</albedo>
- Attachments
-
- 5.png (842.64 KiB) Viewed 3158 times
-
- 6.png (861.91 KiB) Viewed 3158 times
Last edited by fused on Tue Aug 12, 2008 6:57 pm, edited 1 time in total.
To be honest its pretty simple (if you can program to start with)
Anyone know if you can declare variables yet? I mean performance AND readability would increase tremendously
Compare:
to:
And why the Double shader tags? Nesting gone nuts tbh
Anyone know if you can declare variables yet? I mean performance AND readability would increase tremendously
Compare:
Code: Select all
<albedo>
<shader>
<shader>
<![CDATA[
# 3D gradient shader Z (up) with center = 0.5
def eval(vec3 pos) vec3 :
vec3(
div(mod(add(dotk(pos),div(0.6,2.0)),0.6),0.6),
div(mod(add(dotk(pos),div(0.6,2.0)),0.6),0.6),
div(mod(add(dotk(pos),div(0.6,2.0)),0.6),0.6)
)
]]>
</shader>
</shader>
</albedo>
Code: Select all
<albedo>
<shader>
<shader>
<![CDATA[
# 3D gradient shader Z (up) with center = 0.5
def eval(vec3 pos) vec3 :
float color = div(mod(add(dotk(pos),div(0.6,2.0)),0.6),0.6)
vec3( color, color, color )
]]>
</shader>
</shader>
</albedo>
No, you can't declare variables.
However you could factor out the colour computation into another procedure.
Actually, in this case, you can use the scalar vec3 constructor vec3(real x) vec3.
The double shader tags are there to draw a distinction between the type, and value of the albedo material parameter.
However you could factor out the colour computation into another procedure.
Actually, in this case, you can use the scalar vec3 constructor vec3(real x) vec3.
The double shader tags are there to draw a distinction between the type, and value of the albedo material parameter.
it would be cool to declare textures and shaders globally (keeping using the index thing) instead into a material, so they can be called by any of them while delared once only. Maybe this could apply for constant definitions too ?
This idea comes along with the one of a database for constant maybe, and shaders, and with manual coding of shaders. It does not make much sense in regard with the generic scene exporting process.
This idea comes along with the one of a database for constant maybe, and shaders, and with manual coding of shaders. It does not make much sense in regard with the generic scene exporting process.
obsolete asset
i have completely overlooked it!OnoSendai wrote:Actually, in this case, you can use the scalar vec3 constructor vec3(real x) vec3.

ahhh thanks? i told you soDeus wrote:To be honest its pretty simple (if you can program to start with)

@ono:
can you give me a quick example on how if() works? how can i, for example check if a value is > 1?
Who is online
Users browsing this forum: Bing [Bot], DotBot [Bot] and 28 guests