Page 1 of 2

Texture coordinate & material database

Posted: Mon Jun 23, 2008 5:05 pm
by hyltom
I have a lot of problem with the texture coordinate. During i set up my render, the texture coordinate are reset but their parameter are not if i change of material. The reset appear in the viewport (preview mode) and during the rendering. Also, the same thing happen after closing rhino and reopening the scene. The texture parameter are correct but the texture appear off (original coordinate) in the preview and on the render.

Not sure someone can understand my problem :oops: ...sorry for my poor explanation.

Another problem that i have is the use of the material database. I'm not sure to understand correctly the idea behind this database. For me it make the use more complicated. Can it be possible to add material to the scene but not to the database...like before?

Posted: Mon Jun 23, 2008 5:39 pm
by JDHill
I am not sure of the texture-coord problem you are referring to, here I can't seem to find any way to make the viewport appear different than the render. If you can provide more detail (scene scale, RS textures, multiple Rhino mappings, etc.), I will try to see what's happening.

About the database - I'm not sure what you mean by it being more complicated. If you never opened up the Database Manager, the plugin should seem to work pretty much the same as it did before. I just realized that the help files have not been uploaded - I've sent an email to the NL web guy to see if he will update them soon so you can read about how it works.

Anyway, to see what I mean, try this:

- start Rhino
- do not open the Database Manager (pretend it doesn't exist)
- open the Scene Manager
- go to the Materials tab
- drag some Materials from the MXM browser, just as in the previous version
- create a new Material, just as you would in the previous version
- apply some Materials to some objects
- save the file
- close Rhino

Now open Rhino again, and open the file - the same Materials should be in the scene. If you looked, they would have been added to the database, but you don't really need to think about it, unless you want to. So, actually using the Database Manager is up to you.

Until the help files are uploaded, just feel free to ask me any questions about it here.

JD

Posted: Mon Jun 23, 2008 5:57 pm
by hyltom
Thanks for your explanation about how to add material to the scene manager. I was missing the "drag some material from the MXM browser" to add material to the scene manager, because i have never done it this way. Now for sure i will do it like that. But why not also add the function, add material to scene manager, when right click on one material from the MXM browser. I will really like it this way.

About the texture problem, I will try to be more clear.
The viewport and the render looks always the same. The problem is that sometime the texture parameter are "virtually" reset.

Try to follow these step:

1-create a box
2-apply a material that use a texture
3-in the texture mapping properties, change some parameter
4-save the scene and close Rhino
5-open the scene again...the texture preview in the viewport will looks like the one at the step 2 but it parameter are the same than at the end of the step 3.

This is one way to recreate this problem...but i face it many time without closing rhino. It seems the preview and the render can't keep the real texture parameter in memory.

Posted: Mon Jun 23, 2008 6:24 pm
by JDHill
Thanks, I'll add that to the MXM Browser context-menu. It seems a little funny to me - we (developers) try to make everything simple by using drag-drop everywhere, but many times people never even try to use it. :) Using this plugin, just have this principle in mind: 'when in doubt, try to drag something'.

About the textures, I'm still a bit unclear - in (3), do you mean the Rhino Texture Mapping window, or by changing Tile/Offset in the plugin's Material Editor? Texture-mapping works a bit different in this version, and I'm writing a new topic about it right now, since the help files were not updated yet.

Posted: Mon Jun 23, 2008 6:31 pm
by hyltom
For step 3, I mean the rhino texture mapping windows.

Posted: Mon Jun 23, 2008 7:02 pm
by JDHill
Thanks, so you mean that if you create a Rhino mapping, and then change it's rotation or size, that later on the changes are lost? I don't think this would be caused by the plugin - there isn't any code in this version which should ever modify one of your Rhino mappings.

Either way, let's try to figure it out: which Channel does the associated Maxwell texture use? Does it use Real Scale?

Posted: Mon Jun 23, 2008 8:00 pm
by val_z
i got the same problem with the old materials - http://www.maxwellrender.com/forum/view ... hp?t=28621

but i now change all material with real scale. With real scale there is no problem with mapping (for now). To rotate texture I use new maxwell option in rhino plugin.

Posted: Mon Jun 23, 2008 10:44 pm
by JDHill
I have posted a sticky here which goes into the details of how the plugin works with Rhino's material texture tile/offset and explicit Rhino texture-mappings.

Posted: Tue Jun 24, 2008 3:03 am
by hyltom
JDHill wrote:Thanks, so you mean that if you create a Rhino mapping, and then change it's rotation or size, that later on the changes are lost?
Yes, but the change are lost only in the preview. The texture parameter are still there. I have tried on two different computer and i get the same problem. Also i try to use the real scale function but the problem persist.

Posted: Tue Jun 24, 2008 5:11 am
by hyltom
May be using pictures to explain you will be better.

1-Create a volume

Image


2-Apply a maxwell material that used textures to this volume

Image


3-Use the Rhino texture mapping to change the projection and the setting

Image
This is the default setting


Image
Image
This is the new setting

4- Save the file and close Rhino

5-Open the saved file

Image
The preview display the texture with default setting but the parameter are the one of the new setting

This happen only with maxwell materials so it should be related to the plugin.

Posted: Tue Jun 24, 2008 5:35 am
by hyltom
Now i'm trying to follow you sticky but i face one problem.
At this step: "9. the viewport .....You should see that the plugin has created a Rhino material with matching tile/offset values as you set in the Maxwell texture.". Well this is not my case. The tile/offset still display 1 and not 0.25.

I presume that my problem come from here: "Let's discuss what we're dealing with now. We have a Maxwell texture which uses Channel 0, but we have a Rhino mapping on channel 1. Why is this mapping shown when we render? The channels don't match, after all. The reason is: in addition to the list of Rhino mappings you may add using the Texture Mapping window, there is also a default 'viewport' mapping. This mapping is filled with the parameters from whichever explicit mapping is currently being edited, so, when we changed the rotation parameter of the channel 1 Rhino Box mapping we created, this channel 1 mapping was copied into the default viewport mapping, so we could see what we were doing. So therefore, it should now make sense why the Maxwell texture on Channel 0 has the same placement as what is being shown in the viewport."
This is happening but not saved so when close rhino and open the file again, the default 'viewport' mapping (channel 0) is back.

So to correct this behaviour, i have to set all my Maxwell texture to use Channel 1 (same channel than the rhino mapping). By doing this i have no more problem.

Posted: Tue Jun 24, 2008 9:20 am
by JDHill
Yes, I see what you mean now (though I can't see the images). It is true that it changes your viewport, and it is by design. Previously, if you had two Rhino mappings, I'm sure you know that the only way to see one or the other was to actually edit the desired one somehow. Now, as noted in the sticky, you are able to use the plugin to select the desired mapping. This can be done by selecting a texture which uses that mapping.

Now consider this in the context of colors: if you had a red Maxwell Material, then you went into the Rhino material color picker and changed it to green, the plugin would not know about the change. Next time you did something which caused the plugin to update the viewport, your green color would be removed and replaced again with the red one created by the plugin. If this were not the case, the plugin would simply not show its Materials in the viewport.

It is now the same with texture mappings, since the plugin has gained the ability to show a specific one. If you have a textured Material, and its' selected texture uses a specific mapping, then this mapping will be shown when the viewport is updated, just as the red color was shown in the previous example. If this selected texture uses Channel 0, then there are two possibilities:

1. the texture uses Real Scale
2. it does not

If it does, it will then want to make sure that the Real Scale mapping is up-to-date in the viewport. If it does not use Real Scale, it will be set to use the Rhino surface mapping. This is what happens when you turn on and off Real Scale - it switches between surface and box mapping (since planar/box is the only mapping which makes sense for Real Scale). It uses the surface mapping because it does not know which of the other Rhino mappings (if there are any) you may want to see.

Therefore, if the selected texture does not use Real Scale, and the viewport Materials are refreshed, the objects which use this Channel 0 texture will end up showing the default channel 0 non-Real Scale mapping, which is the surface mapping.

I do not know any way to avoid this - if you have three mappings and you show one of them in the viewport by editing its' parameters in the Rhino texture mapping window, the plugin does not know you have done it. This is not really a problem, as far as the plugin is designed: it is designed not for making pretty Rhino viewports, but for allowing you to edit whichever mapping is used by a given texture.

Anyway, if you find this troublesome for your purposes, you may use the new 'Enable/Disable real-time viewport Materials' button in the Database Manager's toolbar - when disabled, nothing at all should be done to the viewport.

JD

p.s. regarding this:
Now i'm trying to follow you sticky but i face one problem.
At this step: "9. the viewport .....You should see that the plugin has created a Rhino material with matching tile/offset values as you set in the Maxwell texture.". Well this is not my case. The tile/offset still display 1 and not 0.25.
Yes, I see here Rhino is reporting me some bogus offset number in the 'Modify...' dialog - I don't know why. Nevertheless, those are the settings that the texture-editor's Tile and Offset parameter's affect, and if the viewport tiling matches the render it means that they are being set correctly. Note that, in the case of Real Scale, the meaning of Tile X/Y works in reverse, so setting a higher Tile X/Y number in the texture-editor will show a lower number in the Rhino 'Modify...' dialog - that is part of the math involved in creating the Real Scale mapping.

Posted: Tue Jun 24, 2008 9:42 am
by hyltom
The way it works now is fine for me as far as i have found how to make it works. :D

Thanks for you time and your precious help.

Posted: Wed Jun 25, 2008 5:10 pm
by hyltom
Back to this topic...i'm not sure i understand all your explanation but anyway as i said i found how it works now so it' fine for me. I just have a suggestion, could it be possible when add a map to a maxwell material that the channel used by this map start by 1 and not 0? I think this will make everything less confusing as when you add a rhino texture mapping control it also start by 1.

Posted: Wed Jun 25, 2008 8:38 pm
by JDHill
I could consider doing that, but I know of four reasons not to:

1. objects with no explicit mappings (so, the default) use Channel 0
2. the new automatic Real Scale works with Channel 0
3. most MXMs people download have textures set to Channel 0
4. it would take some extra time to export two sets of texture coords for every object, when they usually only need one

Mostly, I think it may be more confusing to make things default to Channel 1, especially for newer users, since they would always see Channel 1 for new Materials and usually 0 for imported MXMs. People like you who use advanced features can be expected to correctly match up their channel numbers - you have to do this anyway if you want to get the desired results.

Does that make sense to you? Let me know what you think.

JD