Community
3ds Max Shading, Lighting and Rendering
Welcome to Autodesk’s 3ds Max Forums. Share your knowledge, ask questions, and explore popular 3ds Max materials topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Custom shader, ShaderFX?

4 REPLIES 4
Reply
Message 1 of 5
al.porter
480 Views, 4 Replies

Custom shader, ShaderFX?

Hello Everyone,

 

I am stuck with an issue, any help suggestions would be appreciated. I will try to keep this post as compact as possible.

 

The shader needed reads 2 UV channels:

 

  1. a UV Channel for selecting the area of an atlas texture map
  2. a UV channel to specify the scaling of the selected area specified in channel 1.

The shader should work even if the atlas texture has 2x2 or 8x8 square repeatable textures. The shader only needs to be visible in the viewport providing displaying the textures and real-time feedback when modifying the UV's, the shader does not need to be exported and compatible with Unity.

 

This Shader has been produced within Unity and Blender (cycles)  We tried unsuccessfully using OSL in 3ds Max, after contacting Autodesk Product Support, it was confirmed that there are too many limitations of OSL in 3ds Max. So what's next? ShaderFX? Others? 

 

I wish for in depth assistance, as I am no technical artist, and I have no experience creating a shader or the in-depth intricate knowledge of how the UV system works. 

I am deeply grateful for all ideas, suggestions and assistance. If more information is required then please let me know.

thanks

4 REPLIES 4
Message 2 of 5
CiroCardoso3v
in reply to: al.porter

Can you provide some examples of what you are trying to achieve?

Lead Enviroment Artist @Axis Studios

Arnold Discord Server


Ciro Cardoso

EESignature

Message 3 of 5
al.porter
in reply to: al.porter

Hi Ciro,

 

thanks for getting in touch.

 

Attached you will find the 3ds Max 2024 file with textures within a Zip file. One texture is applied to the cube and shows how the shader should work with the current settings. 

alporter_0-1716274107665.png

 

In the slate editor look for these two nodes:

 

Grid Size X

Grid Size Y

 

The texture above has 2 x 2 (4) repeatable textures, these nodes tell the shader this information. So far so good, all seems to work just fine, until...one changes the values to anything other than 2x2...4x4, 5x5, 6x6 etc don't display correctly. In the Zip is a 8x8 texture, this is the goal. The Shader is also limited, all textures within the square will be considered the same size... 

 

In order to understand whats happening, please look at the UV Unwrap modifiers on the stack. 

I appreciate all help and suggestions.

 

Many thanks

Message 4 of 5
CiroCardoso3v
in reply to: al.porter

Sorry, I missed your message.

 

Thanks for uploading the file with the examples.

 

I think I understand what you want to do. I believe that instead of the Grid Size X and Y being 2x2, or 4x4, etc, you need to go backwards. By the way, you can use another float value and control X and Y with that.

CiroCardoso3v_0-1717567309025.png

 

This X and Y are now 1

CiroCardoso3v_1-1717567337076.png

 

Now, if I change the value to 0.5, I get the texture repeated 4 times

CiroCardoso3v_2-1717567380010.png

 

If I use the value 0.25, it gets repeated 16x.

 

Is this what you need? You mentioned that you managed to do this in Blender, do you have that file? It is easier to see the shader in action and see what you need.

Lead Enviroment Artist @Axis Studios

Arnold Discord Server


Ciro Cardoso

EESignature

Message 5 of 5
al.porter
in reply to: CiroCardoso3v

@CiroCardoso3v

 

Hi and thanks for responding 🙂 

 

The shader was created from a Tech artist using Blender, unfortunately the max file I gave you was his conversion as best as he could manage within 3ds Max.

 

I have included the blender file - I hope it is as it should be, I myself don't use Blender and don't have the priveledges to install it.

 

Thanks for the constructive feedback, at first glance, the images look good - but is the scaling handled on the 3rd UV Channel?

 

As an example, using the current setup and material place the setting to 4x4 or in your case 1.

 

  • in Map channel 1 select the Top UV face and completey cover the wooden texture,  within the atlas Map (resulting in using 25% of the UV space).
  • Add a second UVW Unwrap and set to  Map channel 3, selecting the same face scale the UV face (island) as much or as little as you like.
  • To test, go into Map channel 1 again and position the face over to the stone texture, no adjustment of the scaling is required as they are both the same size. In the viewport the top face of the cube should now only show the stone texture.
  • Now go back into Map Channel 3 and scale the UV island, and as you scale, you should see on the top face in the viewport the stone texture pattern repeat more or less. No other texture should be visible on that top face - ONLY the pixels you defined for that face from Map Channel 1.

I hope the example text above and the blender file help to clarify. 

 

Once again many many thanks for taking the time to help.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report