Can I make a pbr material for display use only?

@nathanletwory I guess you are the one to ask :slight_smile:

I am working on a map viewer that loads tiles from the web, saves on disk and adds them to meshes. But this ads tons of materials to the document.

Is it possible to quickly make a pbr material that won’t show in the material panel?
And what is the fastest way to make a material and assign to an ojbect?
All I need is that it shows the texture png with alpha and that it is not tiled. (If tiling is on the map will show strange artifacts on the edges of each tile)

I don’t think that is possible. When you have an object and assign a material to it (assuming old-style materials) it’ll show up in the materials panel.

I suppose you’re looking to do a DisplayMaterial instead?

I think for that you could create a RenderMaterial (just don’t add it to the doc), then convert it to Material and use that to create a DisplayMaterial.

I am not very familiar with the DisplayConduit stuff, I have done only the most basic of basic usage there.

But I suppose you’d add a DisplayConduit, implement the channel that’s best for your usage where you then draw a shaded mesh using DisplayPipeline.DrawMeshShaded Method (Mesh, DisplayMaterial) . That you can give a Mesh and a DisplayMaterial that aren’t part of the document.

I would set the mesh up such that you have a simple 4-vertex plane, and the texture coordinates (UVs) set up such that the render texture you create for the temporary PBR will just automatically fit (use mapping channel 1, which I believe is the default).

Thanks, I was hoping to avoid the display conduit since it hurts my head and makes the code more complex… but I expected that to be the case.

In case someone is interested: A mesh is very easy to create, and it has mapping applied by default, at least in Rhino 8.

import rhinoscriptsyntax as rs
import scriptcontext as sc
import Rhino

size = 10
pt = rs.GetPoint("Select lower left point")
plane = rs.WorldXYPlane()
plane.Origin = pt
xinterval = Rhino.Geometry.Interval(0,size)
yinterval = Rhino.Geometry.Interval(0,size)
xcount,ycount = 1,1
mesh = Rhino.Geometry.Mesh.CreateFromPlane(plane,xinterval,yinterval,xcount,ycount)
mesh_id = sc.doc.Objects.AddMesh(mesh)

Hello @Holo !
Does your system need to work only in top parallel views, or in all views?