A way to dig a polygon on the imageLayer except with TerrainConstraintLayer? #2542
Answered
by
gwaldron
luoxiaozhu
asked this question in
Support Q&A
-
i added two xyzImageLayers on the earth,and i want to dig a polygon on the lower xyzImageLayer, i know TerrainConstraintLayer works,but i don‘t want to dig my ElevationLayer. So,is there a way to dig a polygon on the imageLayer except with TerrainConstraintLayer? i have try to make a custom shader,code like this: const char* fragShader = R"(
#version 330
void make_it_red(inout vec4 color) {
vec4 colorVec4 = color - vec4(1.0,1.0,1.0,1.0);
if(length(colorVec4)<0.00001)
{
color.a = 0.0;
}
}
)";
VirtualProgram* vp = VirtualProgram::getOrCreate(mapNode->getOrCreateStateSet());
vp->setFunction("make_it_red", fragShader, VirtualProgram::LOCATION_FRAGMENT_LIGHTING);
mapNode->getOrCreateStateSet()->setAttributeAndModes(vp, osg::StateAttribute::ON); but It only works on the upper ImageLayer |
Beta Was this translation helpful? Give feedback.
Answered by
gwaldron
May 22, 2024
Replies: 1 comment 3 replies
-
I do not understand what you want to see. Can you explain it a different way? |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Take a look at the example
shared.earth
in thetests
folder; this concept lets you access one layer's textures in another layer's shaders.