Questions about OpenGL materials in viewport

   5348   10   2
User Avatar
Member
66 posts
Joined: Feb. 2017
Offline
I'm exploring openGL material overrides in the viewport. Very neat how you can separate the openGL material preview settings from the material actually applied (great for viewport previz work).

How the heck do you control the scaling of some of these applied maps though?

For instance, here is an option for a diffuse texture-


The texture automatically uses the UV of the object to apply the map, but does not seem to give the user to control how many times the texture is tiled across the geometry (scale of the texture).

Also, is it possible to use triplanar projection to apply openGL shaders to viewport objects? I see a “UV Layers” group under Render Properties>root>Material Options>OpenGL>UV Layers (shown below)-


Is it possible to somehow use this to control how maps are applied to the openGL viewport shader?

Any help on this would be greatly appreciated.

Thank you.
User Avatar
Member
1769 posts
Joined: Dec. 2006
Offline
Use an uv transforms SOPs scale, that will give you repetitions
daniel bukovec | senior fx td | weta digital
qLib -- http://qlab.github.io/qLib/ [qlab.github.io]
User Avatar
Member
66 posts
Joined: Feb. 2017
Offline
Alright, I can manipulate the scale of my entire UV that way, but that doesn't help with multiple textures as I'd only be able to scale my UV for one texture. This is unless I use UV sets which I have not figured out how to do in 16.5 yet.

Sounds like you just create attr 3flt(tex), name it uv# (# = 1,2,3,….)

At any rate, even if I used uv sets to have one UV per texture map, I don't see options to select what uv to use for the openGL texture for (to scale the whole uv to fit the texture as opposed to scaling the tiling of the texture to fit the UV which makes a lot more sense to me from an optimization standpoint).

And then what does the ogl_uv parameter do out of the openGL group? Thanks for trying, but I'm doubtful that just scaling the UV to match the texture is the optimal way to go about this (under render Properties>Materials>openGl)-


For instance, assuming UV sets are used and I scale the UV to match whatever given texture map, then how do I choose which uv set to use on something like the ogl_normalmap? -



Any further explanations or help would be great! Thank you again.
User Avatar
Staff
5156 posts
Joined: July 2005
Offline
Currently the UV layers are only supported by Heightmap materials. There are plans to expand this to be supported in the general case, but not for 16.5.
User Avatar
Member
66 posts
Joined: Feb. 2017
Offline
twod
Currently the UV layers are only supported by Heightmap materials. There are plans to expand this to be supported in the general case, but not for 16.5.

So just to make sure I understand this correctly. UV Layers are only for height maps, nothing else… There is no way to specify which UV set to use (uv, uv2, uv3, etc…) for openGL texture maps? They just default to the base uv? Also, Triplanar maps are in no way supported for the openGL materials?

Does this sound about correct? Thank you for your time. I didn't find much in the documentation on this.
User Avatar
Staff
5156 posts
Joined: July 2005
Offline
It's currently only possible to layer diffuse textures. You can specify the texture attribute for those layers only. Other map types, such as all the lighting maps, use texture attribute attached to the first diffuse layer.
User Avatar
Member
66 posts
Joined: Feb. 2017
Offline
Thanks for sticking with me on this… I must not be understanding something here or it's not working.

So I have this SOP network-


In the SOP network I create two uv sets. Each with different scale value. One named uv and the other uv2-


I then add these openGL parameters-


Then I pick a map and change the UV Set to either uv or uv2-


Nothing happens when I swap out the UV Set to uv or uv2… That is until I click to add another diffuse layer. THEN and only then does my uv2 pick up-


So, is this some sort of bug? If all the other layers attach to your first texture layer, but selecting the UV Set in the first texture layer does nothing, only in the second texture layer, then you can't do much about anything…?

——–
User Avatar
Member
66 posts
Joined: Feb. 2017
Offline
Here's a video example I just made illustrating my previous post.

User Avatar
Staff
5156 posts
Joined: July 2005
Offline
It wasn't working properly when only 1 layer was present due to an optimization. This has been fixed in 16.5.352.
User Avatar
Member
66 posts
Joined: Feb. 2017
Offline
Thank you for all the help. I'm excited to see openGL previews developed more in the future. I'll be updating to to 16.5.352 today.
User Avatar
Member
159 posts
Joined: Feb. 2018
Offline
twod
Currently the UV layers are only supported by Heightmap materials. There are plans to expand this to be supported in the general case, but not for 16.5.
Hi, is it possible to write GLSL shader for HeightField preview? I've checked the HeightField Quickshade node and found it use the “volvis_blend_masks” keyword to blend layer masks but only support 4 layers in total. Can I extend it or write my own GLSL shader for more than 4 layers terrain material preview?
Thanks.
  • Quick Links