Quantcast
Channel: Bugs Latest Topics
Viewing all articles
Browse latest Browse all 760

FireMaterial Vertex shader

$
0
0

I am using the fire material with my own textures.  I was getting a complaint about shadows with the production and the preview BJS, but it was working.  I put the preview version of fire in and the vertex shader fails over and over.

BJS - [15:08:28]: Error: ERROR: 0:102: 'uv' : undeclared identifier 
ERROR: 0:102: 'assign' :  cannot convert from 'float' to 'out highp 2-component vector of float'
ERROR: 0:124: 'x' :  field selection requires structure, vector, or interface block on left hand side 
ERROR: 0:125: 'y' :  field selection requires structure, vector, or interface block on left hand side 
ERROR: 0:126: 'x' :  field selection requires structure, vector, or interface block on left hand side 
ERROR: 0:127: 'y' :  field selection requires structure, vector, or interface block on left hand side 
ERROR: 0:128: 'x' :  field selection requires structure, vector, or interface block on left hand side 
ERROR: 0:129: 'y' :  field selection requires structure, vector, or interface block on left hand side 
BJS - [15:08:28]: Vertex shader: fire
1	#version 300 es
2	#define DIFFUSE
3	#define ALPHATEST
4	#define BonesPerMesh 20
5	#define NUM_BONE_INFLUENCERS 4
6	
7	precision highp float;
8	
9	in vec3 position;
10	#ifdef UV1
11	in vec2 uv;
12	#endif
13	#ifdef UV2
14	in vec2 uv2;
15	#endif
16	#ifdef VERTEXCOLOR
17	in vec4 color;
18	#endif
19	#if NUM_BONE_INFLUENCERS>0
20	uniform mat4 mBones[BonesPerMesh];
21	in vec4 matricesIndices;
22	in vec4 matricesWeights;
23	#if NUM_BONE_INFLUENCERS>4
24	in vec4 matricesIndicesExtra;
25	in vec4 matricesWeightsExtra;
26	#endif
27	#endif
28	
29	#ifdef INSTANCES
30	in vec4 world0;
31	in vec4 world1;
32	in vec4 world2;
33	in vec4 world3;
34	#else
35	uniform mat4 world;
36	#endif
37	uniform mat4 view;
38	uniform mat4 viewProjection;
39	#ifdef DIFFUSE
40	out vec2 vDiffuseUV;
41	#endif
42	#ifdef POINTSIZE
43	uniform float pointSize;
44	#endif
45	
46	out vec3 vPositionW;
47	#ifdef VERTEXCOLOR
48	out vec4 vColor;
49	#endif
50	#ifdef CLIPPLANE
51	uniform vec4 vClipPlane;
52	out float fClipDistance;
53	#endif
54	#ifdef FOG
55	out vec3 vFogDistance;
56	#endif
57	
58	uniform float time;
59	uniform float speed;
60	#ifdef DIFFUSE
61	out vec2 vDistortionCoords1;
62	out vec2 vDistortionCoords2;
63	out vec2 vDistortionCoords3;
64	#endif
65	void main(void) {
66	#ifdef INSTANCES
67	mat4 finalWorld=mat4(world0,world1,world2,world3);
68	#else
69	mat4 finalWorld=world;
70	#endif
71	#if NUM_BONE_INFLUENCERS>0
72	mat4 influence;
73	influence=mBones[int(matricesIndices[0])]*matricesWeights[0];
74	#if NUM_BONE_INFLUENCERS>1
75	influence+=mBones[int(matricesIndices[1])]*matricesWeights[1];
76	#endif 
77	#if NUM_BONE_INFLUENCERS>2
78	influence+=mBones[int(matricesIndices[2])]*matricesWeights[2];
79	#endif 
80	#if NUM_BONE_INFLUENCERS>3
81	influence+=mBones[int(matricesIndices[3])]*matricesWeights[3];
82	#endif 
83	#if NUM_BONE_INFLUENCERS>4
84	influence+=mBones[int(matricesIndicesExtra[0])]*matricesWeightsExtra[0];
85	#endif 
86	#if NUM_BONE_INFLUENCERS>5
87	influence+=mBones[int(matricesIndicesExtra[1])]*matricesWeightsExtra[1];
88	#endif 
89	#if NUM_BONE_INFLUENCERS>6
90	influence+=mBones[int(matricesIndicesExtra[2])]*matricesWeightsExtra[2];
91	#endif 
92	#if NUM_BONE_INFLUENCERS>7
93	influence+=mBones[int(matricesIndicesExtra[3])]*matricesWeightsExtra[3];
94	#endif 
95	finalWorld=finalWorld*influence;
96	#endif
97	gl_Position=viewProjection*finalWorld*vec4(position,1.0);
98	vec4 worldPos=finalWorld*vec4(position,1.0);
99	vPositionW=vec3(worldPos);
100	
101	#ifdef DIFFUSE
102	vDiffuseUV=uv;
103	vDiffuseUV.y-=0.2;
104	#endif
105	
106	#ifdef CLIPPLANE
107	fClipDistance=dot(worldPos,vClipPlane);
108	#endif
109	
110	#ifdef FOG
111	vFogDistance=(view*worldPos).xyz;
112	#endif
113	
114	#ifdef VERTEXCOLOR
115	vColor=color;
116	#endif
117	
118	#ifdef POINTSIZE
119	gl_PointSize=pointSize;
120	#endif
121	#ifdef DIFFUSE
122	
123	vec3 layerSpeed=vec3(-0.2,-0.52,-0.1)*speed;
124	vDistortionCoords1.x=uv.x;
125	vDistortionCoords1.y=uv.y+layerSpeed.x*time/1000.0;
126	vDistortionCoords2.x=uv.x;
127	vDistortionCoords2.y=uv.y+layerSpeed.y*time/1000.0;
128	vDistortionCoords3.x=uv.x;
129	vDistortionCoords3.y=uv.y+layerSpeed.z*time/1000.0;
130	#endif
131	}

 


Viewing all articles
Browse latest Browse all 760

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>