Search the Community
Showing results for tags 'Material'.
-
Hi there, I'm wondering if there are any internal Unigine projects, or a scripting example that shows how you can enable real-time material or mesh swapping for an ArchViz scene, allowing users to change fabrics or pieces of furniture at runtime? Thanks!
-
Hi there I'd like to access the parameters of the cloud material to simulate different wind at runtime. We need a controlable environment, in which the user can define the specific wind power and direction and the clouds should react correctly to those. Is there a possibility to get a handle to the velocity and the angle of the animation settings? Thanks in advance
-
Hello everyone. I was a newcomer. As stated in the engine, how fast can the material to multiple objects (these objects with the same shader). Thanks for any help. In addition, I would like to know how multiple objects to quickly specify the location of the object rather than manually one by one to set the coordinates of the different objects. Thanks again.
-
[WONTFIX] Saturation/Desaturation for all materials
werner.poetzelberger posted a topic in Feedback for UNIGINE team
Hi, I think it would be quite handy to have a saturation/desaturation option for each material for the final appearance, between the actual color as it is rendered and a grey value. Maybe it as well could be extrapolated towards a higher saturation. Like (0<-1(as it is)->2). We had implemented this option for our shaders using our previous engine. It is very handy when it comes to bringing together many scene elements, as the composition of the final image is much easier and more pleasing. Best. Werner -
[SOLVED] Replace material on many objects, "material selector"
anton.stetz posted a topic in UnigineScript
Hi all I need to be able to replace materials on the objects through code. Example: I have material "sample_01", which is assigned to many objects and surfaces in the current scene. Now I want all of these objects to assign material "sample_02", then sample_03 etc. These materials are in the same library, and have a clear structure by name. My idea: temp = sample_01.getObjects (); temp.setMaterial (sample_02); But the functions of type material :: getObjects in documentation is not found. Now I look in the direction of Material :: saveState and Material :: restoreState. Maybe you have any other solutions to this issue? thanks in advance- 9 replies
-
- material
- material selector
-
(and 1 more)
Tagged with:
-
HI! I create a earth model.and add image for it. add image for Node code: ObjectMeshDynamic* pTile = new ObjectMeshDynamic(); Image* image; image = getImage(...); if(image != NULL) { Material* matTex = pTile->getMaterialInherit(0); matTex->setImageTextureImage(matTex->findTexture("diffuse"),*image,1); } Now i create next layer,so i want to remove the old node.remove node code: string meshName = "mesh_"+xyw_replace(tt_tileKey,pattern,dstPattern); if(engine.materials->findMaterial(meshName.c_str())) { int retv = engine.materials->removeMaterial(meshName.c_str()); } _pGlobeRoot->removeChild(tileNode); // NodeDummy *_pGlobeRoot = new NodeDummy(); _pGlobeRoot is tree root node. if (engine.editor) { engine.editor->removeNode(tileNode); } But i find my computer's memory that go up,not go down. removeMaterial() function ,can it remove it's image? i think that the image is not remove???
-
Hello, I wanted to know if I have applied a material "red" to Node A and apply material "green" to Node B and if I make Node B child of Node A, will the materials applied to Node B be overidded with materials of Node A? Below is the pseudo code for it nodeA.setMaterial("red", "*"); nodeB.setMaterial("green", "*"); nodeA.addChild(nodeB); I want to this because I have another query on WidgetSpriteNode based on this answer Thanks
-
Hi guys, I am new to unigine and this forum, sorry if I am duplicating topic. I am working on selection decals ( selection ring around unit(s)/structure while they are selected ). What I want is to create lots of decals from one base material with different ( random ) colors using "color_scale" parameter to distinguish each of them. I mean unit selection ring according to player color. This is what I did till now but it's not working : strMaterial is base material. string strMaterialWithColor = format("%s, %.2f, %0.2f, %0.2f, %0.2f", strMaterial, vColorModifier.x, vColorModifier.y, vColorModifier.z, vColorModifier.w); int idLibrary = engine.materials.findLibrary("world1.mat"); if(idLibrary == 0) { idLibrary = engine.materials.addWorldLibrary("world1.mat"); } if(idLibrary == 0) { strMaterialWithColor = strMaterial; } if(idLibrary != 0 && engine.materials.findLibraryMaterial(idLibrary, strMaterialWithColor) == -1) { int idMaterial = engine.materials.cloneMaterial(strMaterial, "world1.mat", strMaterialWithColor); Material mat = engine.materials.getMaterial("world1.mat", idMaterial); mat.setParameter("color_scale", vColorModifier); } else { strMaterialWithColor = strMaterial; } DecalOrtho decal = new DecalOrtho(vPos.z + DECAL_PROJECTOR_OFFSET, 2, 2, strMaterialWithColor ); Please help me.