Here is my code in QtDesign studio 4.0
CustomMaterial { id: customMaterial1 property color ambient: Qt.rgba(0.15, 0.35, 0.50, 1.0) property color ka: Qt.rgba(0.15, 0.35, 0.50, 1.0)//ambient property color specularColor: Qt.rgba(0.2, 0.2, 0.2, 1.0) property real shininess: 150.0 property real textureScale: 1.0 property real offsetx: 0.0 property real offsety: 0.0 property real wavescale: 0.0 property real specularity: 1.0 property real waveheight: 0.1 property real waveStrenght: 0.1 property real normalAmount: 2.0 property real waveRandom: 1.0 property real texCoordScale: 1.0 property real vertYpos: 0.0 property TextureInput foamTexture: TextureInput { enabled: true texture:Texture{ id: foamTexture source:"../../../textures/foam.jpg"} } property TextureInput skyTexture: TextureInput { enabled: true texture: Texture{ id: skyTexture source:"../../../textures/sky.jpg" } } property TextureInput waveTexture: TextureInput { enabled: true texture: Texture{ id: waveTexture source:"../../../textures/Waterwave.jpg" } } property TextureInput specularTexture: TextureInput { enabled: true texture: Texture{ id: specularTexture source:"../../../textures/WaterSpecular.jpg" } } property TextureInput diffuseTexture: TextureInput { enabled: true texture:Texture{ id: diffuseTexture source:"../../../textures/WaterDiffuse.jpg" } } property TextureInput normalTexture: TextureInput { enabled: true texture:Texture{ id: normalTexture source:"../../../textures/WaterNormal.jpg" } } shadingMode: CustomMaterial.Unshaded vertexShader: "../../../shaders/test/water.vert" fragmentShader: "../../../shaders/test/water.frag" }I got two error in QtCreator when I am changing projection from QtDesign Studio to QtCreator
QSpirvCompiler: Failed to parse shader
Failed to compile vertex shader:
"custom material -->water.vert>water.frag:a46ea2d3d2c9243dfc30960db194be3a87c3dd21;hasLighting=true;lightCount=5;specularModel=Default;;diffuseMap={;;;;};emissiveMap={;;;;};specularMap={;;;;};baseColorMap={;;;;};bumpMap={;;;;};specularAmountMap={;;;;};normalMap={;;;;};clearcoatNormalMap={;;;;};opacityMap={;;;;};roughnessMap={;;;;};metalnessMap={;;;;};occlusionMap={;;;;};translucencyMap={;;;;};heightMap={;;;;};clearcoatMap={;;;;};clearcoatRoughnessMap={;;;;};transmissionMap={;;;;};thicknessMap={;;;;};opacityMap_channel=R;roughnessMap_channel=R;metalnessMap_channel=R;occlusionMap_channel=R;translucencyMap_channel=R;heightMap_channel=R;clearcoatMap_channel=R;clearcoatRoughnessMap_channel=R;transmissionMap_channel=R;thicknessMap_channel=R;boneCount=0;overridesPosition=true;alphaMode=Default;;vertexAttributes={position=true;normal=true;texcoord0=true;;tangent=true;binormal=true;;}};morphTargetCount=0;morphTarget0Attributes={;;;;;;;}};morphTarget1Attributes={;;;;;;;}};morphTarget2Attributes={;;;;;;;}};morphTarget3Attributes={;;;;;;;}};morphTarget4Attributes={;;;;;;;}};morphTarget5Attributes={;;;;;;;}};morphTarget6Attributes={;;;;;;;}};morphTarget7Attributes={;;;;;;;}}"
"ERROR: :65: 'location' : overlapping use of location 16\nERROR: 1 compilation errors. No code generated."
QSpirvCompiler: Failed to parse shader
Failed to compile vertex shader:
"custom material -->water.vert>water.frag:a46ea2d3d2c9243dfc30960db194be3a87c3dd21;hasLighting=true;lightCount=5; ... same as above"
"ERROR: :63: 'location' : overlapping use of location 16\nERROR: 1 compilation errors. No code generated."
There is my shader.vert:
#version 330 core
VARYING vec3 vertexPosition;
VARYING vec3 vertexNormal;
VARYING vec2 vertexTexCoord;
VARYING vec4 vertexTangent;
VARYING vec3 worldPosition;
VARYING vec3 worldNormal;
VARYING vec4 worldTangent;
VARYING vec2 texCoord;
VARYING vec2 movtexCoord;
VARYING vec2 multexCoord;
VARYING vec2 waveTexCoord;
VARYING vec2 skyTexCoord;
VARYING vec3 vpos;
VARYING mat4 modelMatrix;
VARYING mat3 modelNormalMatrix;
VARYING mat4 mvp;
VARYING vec3 eyePosition;
void MAIN()
{
modelMatrix = MODEL_MATRIX
modelNormalMatrix = NORMAL_MATRIX
mvp = MODELVIEWPROJECTION_MATRIX
}