Blurry textures with custom shader 2003-12-08 - By Bryan Ewert
Back ?from Sun, 7 Dec 2003 20:46:01 -0800
> I have created a custom shader node. When applied to a mesh, the texture > looks correct when I render, but is blurry in the viewport.
> Does anyone know what's going on here?
You need to create and connect a materialInfo node to your shading network. Maya does this for you with the built-in shaders, but expects you to take care of this for custom shaders.
1. Trace the material's ".color" attribute upstream to find the texture node.
2. Create a materialInfo node.
3. Connect the texture's ".message" attribute to an element in the materialInfo's ".texture" attribute:
connect file1.message materialInfo1.texture[0];
4. In the Material's Attribute Editor, expand the "Hardware Texturing" section, and select "Color" as the texture channel.
Don't want to do this manually everytime you create a shader? Create callbacks in your shader node - e.g. MNodeMessage::addAttributeChangedCallback and MDGMessage::addNodeAddedCallback - to wire this up for you automatically. Be careful though, as there are several gotchas waiting for you. I've spent over a year chasing this one, continually finding little exceptions and special cases where my custom shader must (or must not) intercede to maintain visual acuity.
-- Bryan Ewert ?maya@(protected) ?http://www.ewertb.com ?
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --- List-help: <mailto:listar@(protected)?Subject=help> List-archive: <http://www.highend3d.com/maya/devarchive/>
|
|