Blender Procedual Textures in Lux

Discussion related to the LuxRender Material system, programming API and Scene file format.

Moderators: jromang, tomb, zcott, coordinators

Blender Procedual Textures in Lux

Postby mfoxdogg » Sat May 10, 2008 1:03 am

Hey all luxrender's lack of textures is rather big concern as you have to bake everything to a image and that doesn't really go too well when you have hundreds of objects in the scene so i propose that we use the mapping and Procedural textures of blender in addition to the ones already present in lux so anything made in blender can be made in lux without baking.

I have asked the blender lead developer Ton if we can use blender's source code and he said its ok :)

so for anyone who is interested the code is at these 3 places, unfortunately it is written in C

http://projects.blender.org/plugins/scm ... r&view=log
http://projects.blender.org/plugins/scm ... r&view=log
http://projects.blender.org/plugins/scm ... r&view=log

I am a blender developer and experienced blender user, ~5years experience, so if you need any testing or a chat with blender devs just drop me a line :)
To a Beginner there are endless possiblities, to an expert ther are few
User avatar
mfoxdogg
 
Posts: 19
Joined: Sun Oct 21, 2007 5:43 am
Location: Duri, Australia

Re: Blender Procedual Textures in Lux

Postby Radiance » Sat May 10, 2008 1:23 am

sweet,

We can take this up after v0.5 release :)

I was thinking this could be a good job for smisra, if he wants it :)
It will allow him to get familiar with the mapping/texturing/scenefile parts of the engine,
which will need optimizations afterwards...

greetz,
radiance
User avatar
Radiance
 
Posts: 3968
Joined: Wed Sep 19, 2007 2:13 am

Re: Blender Procedual Textures in Lux

Postby SMISRA » Sun May 11, 2008 9:22 pm

Sure I can follow the work out here. I will need a lot of guidance though. :) And am happy to to be among a bunch of skillful people.
~Thanks
Shakti
SMISRA
 
Posts: 43
Joined: Tue Apr 29, 2008 10:24 am

Re: Blender Procedual Textures in Lux

Postby Dade » Mon May 12, 2008 1:14 pm

SMISRA wrote:Sure I can follow the work out here. I will need a lot of guidance though. :) And am happy to to be among a bunch of skillful people.


I did the port of Blender code for procedural textures and implemented blender_musgrave and blender_marble as example of usage of the Blender functions (Mantis task: http://www.luxrender.net/mantis/view.php?id=142).

The first results look good:

scr0.jpg


scr1.jpg


scr2.jpg


Smisra, if you want you can take on the task. There are the following textures still port:

TEX_CLOUDS
TEX_WOOD
TEX_MAGIC
TEX_BLEND
TEX_STUCCI
TEX_NOISE
TEX_VORONOI
TEX_DISTNOISE

I did TEX_MUSGRAVE, TEX_MARBLE and all the Blender functions are already available. It is a mater of writiting the glue code between Lux and Blender functions. You can use textures/blender_musgrave.cpp and textures/blender_marble.cpp as examples.
User avatar
Dade
Developer
 
Posts: 4795
Joined: Sat Apr 19, 2008 6:04 pm
Location: Italy

Re: Blender Procedual Textures in Lux

Postby Dade » Mon May 12, 2008 1:17 pm

I forgot to add an example of blender texture usage in Lux scene:

Code: Select all
Texture "proc_col2" "color" "constant" "color value" [1.0 0.0 0.0]
Texture "proc_col1" "color" "constant" "color value" [1.0 1.0 1.0]
#Texture "proc_tex" "float" "blender_musgrave" "integer noisebasis" [8]
Texture "proc_tex" "float" "blender_marble"
Texture "proc_mix" "color" "mix" "texture tex1" ["proc_col1"] "texture tex2" ["proc_col2"] "texture amount" ["proc_tex"]
MakeNamedMaterial "mat_proc" "string type" ["matte"] "texture Kd" ["proc_mix"] "float sigma" [0.000000] "float bumpmap" [0.000000]

AttributeBegin
   Transform [1.0 0.0 0.0 0.0  0.0 1.0 0.0 0.0  0.0 0.0 1.0 0.0  0.0 0.0 1.0 1.0]
   NamedMaterial "mat_proc"
   Shape "sphere" "float radius" [1.0]
AttributeEnd
User avatar
Dade
Developer
 
Posts: 4795
Joined: Sat Apr 19, 2008 6:04 pm
Location: Italy

Re: Blender Procedual Textures in Lux

Postby Radiance » Mon May 12, 2008 11:25 pm

nice work Dade :)

I'll have a proper look/test of it tonight :)

greetz,
radiance
User avatar
Radiance
 
Posts: 3968
Joined: Wed Sep 19, 2007 2:13 am

Re: Blender Procedual Textures in Lux

Postby dougal2 » Tue May 13, 2008 12:12 am

hm.. i might have to see if I can implement the blender procedurals as new texture nodes for maya.
Of course, Maya has it's own set, but only Autodesk knows the functions behind them :evil:
User avatar
dougal2
Developer
 
Posts: 3074
Joined: Mon Jan 14, 2008 7:21 am

Re: Blender Procedual Textures in Lux

Postby mfoxdogg » Tue May 13, 2008 12:34 am

great work dade looks really good but, i have 1 little crit, instead of "integer noisebasis" [8] have "string noisebasis" ["voronoi crackle"], once again great and thanks so much :)
To a Beginner there are endless possiblities, to an expert ther are few
User avatar
mfoxdogg
 
Posts: 19
Joined: Sun Oct 21, 2007 5:43 am
Location: Duri, Australia

Re: Blender Procedual Textures in Lux

Postby Radiance » Tue May 13, 2008 9:17 am

Hi,

I've ran some tests and it works on win32 after changing a pow to a powf in the blender_noiselib.cpp (i commited this change)
I also added the options for transformation of 3d space i added yesterday to the pbrt textures.

One thing which is strange is that they only implement FloatTexture ?
I think we should add a SpectrumTexture definition too.
We should supply 2 Textures as params to modulate between. (make it like the mix texture)
I don't want to do this now as i don't know if you have this planned dade, please let me know.
if you can't do it i can have a crack tomorrow doing it :)

having no implementation for CreateSpectrumTexture breaks the standard and the engine will complain. :)

besides this the string parameters for the noise types as mfoxdogg suggested seems a good idea too.

greetz,
radiance

PS: attached a preliminary (incomplete implementation in luxblend)
Attachments
blendtest2.jpg
User avatar
Radiance
 
Posts: 3968
Joined: Wed Sep 19, 2007 2:13 am

Re: Blender Procedual Textures in Lux

Postby Radiance » Tue May 13, 2008 9:31 am

another thing that pops up,
do the different noisetypes have different options ?

maybe we should create an interface for these ?

Radiance
User avatar
Radiance
 
Posts: 3968
Joined: Wed Sep 19, 2007 2:13 am

Next

Return to Materials, API & Scene file format

Who is online

Users browsing this forum: No registered users and 1 guest