Giter Club home page Giter Club logo

thunderloom's Introduction

ThunderLoom

teaser8 A physically based shader for woven cloth

This projects consits of three main parts:

  • Irawan shading model

At its core is an implementation of the 'Irawan' shading model, as presented in the phd thesis by Piti Irawan and in the paper by Irawan and Marschner (2012).

  • Library with API

The shading model is made accessible for rendering engines with added flexibilty and artistic control through a library with a simple API. This allows the model and extra improvements to quickly be integrated into custom rendering pipelines or created as plugins to more established renderers.

The library allows fast and flexible control over many parameters of how the woven cloth is to behave. The actual pattern is determined using standard weaving-drafts defined in WIF files. Many types of patterns are freely available from fine sites such as handweaving.net.

  • Frontends/plugins

Three plugins using this library have been made. V-Ray for 3dsMax, V-Ray for Maya and a limited plugin for Mitsuba, which includes a patch for the mtslbend plugin for Blender. There is also a pattern editor which can be used on its own to create or alter weaving patterns. See the subfolders for these frontends for more information.

Installing the frontends

Precompiled binaries can be found under the releases tab. The zip file includes plugins for V-Ray for 3dsMax, Maya and for the mitsuba renderer.

See the respective README files for specific install instructions.

Library

The source code for the library and core is found in the 'src' folder. The file 'thunderloom.h' describes the API of the shader.

For an example implementaion see frontends/api_demo/.

Licence

The source code is released under the MIT Licence.

But if you happen to make something cool using this, a nice render or an improved tool, please let us know! We would love to see it! :)


3 pillars with different types of cloth rendered using thunderLoom in vray/3dsMax

thunderloom's People

Contributors

petermcevoy avatar vidarn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

thunderloom's Issues

V-Ray Standalone: Incorrect loading of yarn specific float and bool parameters.

E.g.

BRDFThunderLoom BRDFThunderLoom {
filepath="test2.ptn";
uscale=4;
vscale=4;
uvrotation=0;
yarnsize=List(0.1, 0.2, 0.3);
yarnsize_on=List(1,0,1);
}

Won't load yarnsize and yarnsize_enabled values for yarn type 0, 1 and 2.
yarnsize_enabled is always 0 and yarnsize will be set to the last value, for all yarn types.

Maya batch render different from Maya interactive render (spec amount)

If the spec amount is set to 1.0 this will render as expected in Maya, but the batch render will be black (zero spec). This happens regardless of what the spec color is.

A workaround is to set the spec amount to 0.99 (or lower as desired), but I thought this would be a good thing to fix on the shader internally, as there seems to be a math glitch somewhere causing this.

Create a default pattern

Right now, the shader renders very strange until a pattern is loaded. We should make sure that there’s a nice default pattern

Fresnel

Add a Fresnel term to mix Diffuse and specular as a dielectric

Maya crashes with daisy chain node inputs into Thunderloom

Maya will crash if there are too many "daisy chain" connections into Thunderloom shader.

For example if I connect a file texture to the type1 spec color, this works fine (a into B). Further, if I connect a file texture to a VrayFalloff, then connect that to the type1 spec color (a into b into c) this also works fine. However if I add an additional step to the daisy chain: texture map > gamma > falloff > thunderloom spec (a into b into c into d), this will crash Maya. In other words if the daisy chain gets too long (three links) it crashes.

Work around is of course to minimize the node chain length.

diffuse "roughness" slider like VrayMtl

@petermcevoy @vidarn

Gentlemen, a feature suggestion:
The VrayMtl has a diffuse "roughness" slider which goes between Lambertian diffuse (roughness=0) and Oren-Nayer diffuse (roughness=1). This has a "powdery" look to the diffuse shading which looks nicer with soft fabrics like cotton.

If this would be something that could be pulled from the VrayMtl BRDF into the Thunderloom shader (and therefore hopefully not hard to implement), I think it could visually be quite nice. Hope you will consider it.

best,
Derek

ThunderLoom in GI and diffuse render element

The shader does not appear in the GI render element (RE) and it is also missing in the diffuse RE. It would be really great if it could appear in the diffuse RE because then one could bake the diffuse WIF pattern into a texture map. This would open up TONS of really great possibilities for look-dev, and so.would be my number 1 wish.

Suggested by Derek Flood.

Arbitrary uv texture lookup on V-Ray Standalone/V-Ray for Maya is not implemented.

The function tl_eval_texmap_mono_lookup in vray_thunderloom.cpp is not implemeted.
This means that there will be problems when varying yarnsizes non-uniformly, such as with a changing texture. I can't find a way to achieve this sort of lookup using the V-Ray APIs.

See my question on the ChaosGroup forums for more info: https://forums.chaosgroup.com/forum/v-ray-for-maya-forums/v-ray-for-maya-sdk/76255-texture-lookup-with-uv-on-non-bitmap-textures

See the implementation of tl_eval_texmap_mono_lookup in vray3dsMax/3dsMax/Eval.cpp for how it works in V-Ray for 3dsMax.

Release for Vray Next

Howdy,
Would it be possible to put up a Windows compile for Vray Next (for Maya 2017, 2018, 2019) on the Release page?

Thanks!

Frontend support for Arnold?

Greetings!

I was just wondering, is there any chance we might see a front end for Arnold 5.x anytime soon?

Cheers,
-CMPX

Zero values for bend breaks shader

Bug: Having zero in the bend will break the shader, meaning the spec goes black. Non-zero values (0.001) work fine. So perhaps the slider should be made so it cannot go to zero, but just a little above that.

Mult helper sliders for colors.

  • Diffuse amount slider (mult)
    Multiply diffuse color with this factor.

  • texture gamma text field
    "texture gamma" field where the user could input the gamma to be used for all the colors. Currently they each need to be linearlized individually which takes a lot of work to set up. So having a single place to control this for all the diffuse colors would be very helpful. The pseudo code would be "pow (color, texture_gamma)" so the default value of 1.0 would leave the colors unchanged, and a value of 2.2 would linearize all the diffuse colors from sRGB (2.2) to linear (1.0).

Suggested by Derek Flood.

Specular color

Allow changing the color of the specular reflections.

Reveal "alpha" slider

I've been testing the "alpha" slider that Peter revealed for me in a branch of the shader, and can say that it is really helpful for getting "metallic" fabrics like silk to look right (honestly I was not able to get silk to look right without it). So I'd put in my vote for keeping this exposed in the shader. For example, changing the alpha from the default value of 0.05 to 1 makes the spec basically uniform like a metal, rather than a dielectric material. Thus giving the "metallic" look of a silk.

I would suggest giving it a more descriptive name than "alpha" which indicates its purpose, like the other attribute names in the shader do. Perhaps you could call it "uniform specularity" or maybe even "metalness."

Compatibility with Vray Next

Greetings,
I've tested to use Thunderloom with Vray 3.6 for my recent project, and it worked very well
and it was so impressive. This tool enable artists to create entirely new and believable fabric texture.
But it doesn't seems to work well with Vray 4.x (aKa Vray Next), There were error log like, 'BRDFThunderloom shader cannot be loaded.'

Improve “diffuse” shading

The current diffuse shading is quite lacking. To improve this, we should probably look at how it’s done in hair shaders. I believe what we’re after is multiple scattering. The specular reflection is single scattering since the light scatters once before leaving the yarn.
I have found this paper: http://www.cemyuksel.com/research/dualscattering/dualscattering.pdf
which seems like a good starting point. It is referenced from Pixar’s memo on hair rendering found here: http://graphics.pixar.com/library/DataDrivenHairScattering/paper.pdf
I believe @sharktacos has a lot of insight into how this is handled in hair shading

Diffuse falloff error when using GI and directional-light in V-Ray for Maya.

The falloff of the diffuse component looks off when GI is enabled and a directional light is used.

The error appears to be most noticeable with the Maya lights (directional, sphere, point, etc) as opposed to the Vray Lights. I also observe that the error is only present if GI is on. The GI part confuses me frankly, but the affect of turning it off completely eliminates the error. Tested on Vray 3.5.01, 3.5.02, 3.5.03, and the nightlies for 3.6.

thunderloomdiffuseerror

shirtThundeloomDiffError2.zip

gi_maya_directional.vrscene.zip

Issue found by Derek Flood.

Rotate UV

@petermcevoy Please add the ability to rotate the UVs (enhancement). Pretty please!

This should happen after the UV scale parameters.
This would make it possible to create knit as well as woven patterns:
image

Vray Diffuse RE

The Vray Diffuse Render Element is not working correctly in Maya currently. It appears to return the Raw GI, rather than the diffuse (i.e. the flat texture color).

keep default yarn type settings option when resetting pattern file

Feature request: It would be helpful to have a checkbox option under "reset yarn types from file" to "keep default yarn type settings." That way if one wanted to change the pattern (PTN/WIF) they would not lose the default yarn type settings when they loaded it in.

how to install ThunderLoom

hey! im new in 3dmax 2015- vray 3.0, i want to use "ThunderLoom" is it possible?
I already read several post here about installation, was like Chinese :D.. i really dont know Cmake, SDK, .... how to do it

Maya crashes when texture is input into default color slots

Getting frequent crashes in Maya when connecting a texture map (Maya file node) to the Spec color and diffuse color. Sometimes the error is just Vray crashing

"Error: Vray: There was a fatal error rendering the scene"

other times Maya crashes completely:

"Runtime Error! Program: C:\Program Files
Autodesk\Maya2017\bin\maya.exe R6025 - pure virtual function call"

A workaround for this appears to be to connect the textures to the individual yarn types (ex: yarn type1 specular color" ) instead of to the "default yarn type" spec Color or diffuse color.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.