Regression in v151 or behaviour change?

It appears that two shader fragments are MIA in v151.2 for MeshPhongMaterial (and possibly other material types too). I’m not sure if this is a behaviour change or a regression.

I’m using onBeforeCompile to customise the shader. When I print the pre-compiled vertexShader to debug (breakpoint in onBeforeCompile, here’s what I get for v150.1:

#define PHONG
varying vec3 vViewPosition;
#include <common>
#include <uv_pars_vertex>
#include <uv2_pars_vertex>
#include <displacementmap_pars_vertex>
#include <envmap_pars_vertex>
#include <color_pars_vertex>
#include <fog_pars_vertex>
#include <normal_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <shadowmap_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
	#include <uv_vertex>
	#include <uv2_vertex>
	#include <color_vertex>
	#include <morphcolor_vertex>
	#include <beginnormal_vertex>
	#include <morphnormal_vertex>
	#include <skinbase_vertex>
	#include <skinnormal_vertex>
	#include <defaultnormal_vertex>
	#include <normal_vertex>
	#include <begin_vertex>
	#include <morphtarget_vertex>
	#include <skinning_vertex>
	#include <displacementmap_vertex>
	#include <project_vertex>
	#include <logdepthbuf_vertex>
	#include <clipping_planes_vertex>
	vViewPosition = - mvPosition.xyz;
	#include <worldpos_vertex>
	#include <envmap_vertex>
	#include <shadowmap_vertex>
	#include <fog_vertex>
}

With v151.2, I get the following:

#define PHONG
varying vec3 vViewPosition;
#include <common>
#include <uv_pars_vertex>
#include <displacementmap_pars_vertex>
#include <envmap_pars_vertex>
#include <color_pars_vertex>
#include <fog_pars_vertex>
#include <normal_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <shadowmap_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
	#include <uv_vertex>
	#include <color_vertex>
	#include <morphcolor_vertex>
	#include <beginnormal_vertex>
	#include <morphnormal_vertex>
	#include <skinbase_vertex>
	#include <skinnormal_vertex>
	#include <defaultnormal_vertex>
	#include <normal_vertex>
	#include <begin_vertex>
	#include <morphtarget_vertex>
	#include <skinning_vertex>
	#include <displacementmap_vertex>
	#include <project_vertex>
	#include <logdepthbuf_vertex>
	#include <clipping_planes_vertex>
	vViewPosition = - mvPosition.xyz;
	#include <worldpos_vertex>
	#include <envmap_vertex>
	#include <shadowmap_vertex>
	#include <fog_vertex>
}

The following two lines are missing from the v151.2 output:

#include <uv2_pars_vertex>
...
#include <uv2_vertex>

Is there some breaking change to how the material needs to be configured in order to include those shader fragments, or is this a possible regression?

(For context, my custom shader relies on vUV being defined, but in 151.2 it no longer is.)

Thanks,

Stephen

OK - so I missed that it’s uv2_pars_vertex that is gone (looks like it’s been refactored out of the code base).

So I guess, my question is why might vUV no longer be defined for my custom shader? It would suggest that for some reason the defines have changed (i.e. USE_UV is no longer being defined elsewhere by the material).

Related:

1 Like

Thank you! I’ve previously read advice from @Mugen87 not to set DIY defines in custom shaders, but I guess that’s no longer always true.