ShadowZelda Posted September 11 Share Posted September 11 Hello, We are trying to recreate a headlight inside Unigine. We are using IES profiles and a texture to do so, but we are running into a main problems, causing two big issues: 1. The shape of the light source can be seen in reflections and if it is near to a wall/other object. To create a realistic result, we would therefore need to change the shape from point to a rectangle, because we can´t hide the shape (old question and workaround was tried, but isn´t applicable in this case: https://developer.unigine.com/forum/topic/8400-setting-up-projected-lights-without-seeing-the-light-source/#comment-41318) So far so good, but if we switch the shape type to rectangle, this error message occurs in the console, because the shader can´t be compiled: Quote Compilation log: (5236,133-149): error X3004: undeclared identifier 's_light_fov_scale' hlsl 5236: light_color *= toFloat3(s_texture_TEX_MODULATION.SampleLevel(s_sampler_TEX_MODULATION, float2(vertical_angle, horizontal_angle * s_light_fov_scale), 0.0f).r); (5236,91-150): error X3014: incorrect number of arguments to numeric-type constructor hlsl 5236: light_color *= toFloat3(s_texture_TEX_MODULATION.SampleLevel(s_sampler_TEX_MODULATION, float2(vertical_angle, horizontal_angle * s_light_fov_scale), 0.0f).r); Material:"core/materials/base/render/lighting/deferred_light/lights/render_light.basemat" Material::getShader(): can't compile pass:"light_proj" material:"core/materials/base/render/lighting/deferred_light/lights/render_light.basemat" As soon as I switch the shape back to point, it works again. Note: It only works with the point shape. Switching to Rectangle, Capsule or Sphere causes error logs. I couldn´t find a restriction in the documentation. Changing the field of view settings or other parameters in the light, for example the mode or intensity, has ne influence on the issue. Enable or Disable Relative to POV also doesn´t change anything. Quote Compilation log: (5236,133-149): error X3004: undeclared identifier 's_light_fov_scale' hlsl 5236: light_color *= toFloat3(s_texture_TEX_MODULATION.SampleLevel(s_sampler_TEX_MODULATION, float2(vertical_angle, horizontal_angle * s_light_fov_scale), 0.0f).r); (5236,91-150): error X3014: incorrect number of arguments to numeric-type constructor hlsl 5236: light_color *= toFloat3(s_texture_TEX_MODULATION.SampleLevel(s_sampler_TEX_MODULATION, float2(vertical_angle, horizontal_angle * s_light_fov_scale), 0.0f).r); Material:"core/materials/base/render/lighting/deferred_light/lights/render_light.basemat" Material::getShader(): can't compile pass:"light_proj" material:"core/materials/base/render/lighting/deferred_light/lights/render_light.basemat" Compilation log: (5227,133-149): error X3004: undeclared identifier 's_light_fov_scale' hlsl 5227: light_color *= toFloat3(s_texture_TEX_MODULATION.SampleLevel(s_sampler_TEX_MODULATION, float2(vertical_angle, horizontal_angle * s_light_fov_scale), 0.0f).r); (5227,91-150): error X3014: incorrect number of arguments to numeric-type constructor hlsl 5227: light_color *= toFloat3(s_texture_TEX_MODULATION.SampleLevel(s_sampler_TEX_MODULATION, float2(vertical_angle, horizontal_angle * s_light_fov_scale), 0.0f).r); Material:"core/materials/base/render/lighting/deferred_light/lights/render_light.basemat" Material::getShader(): can't compile pass:"light_proj" material:"core/materials/base/render/lighting/deferred_light/lights/render_light.basemat" Compilation log: (5220,133-149): error X3004: undeclared identifier 's_light_fov_scale' hlsl 5220: light_color *= toFloat3(s_texture_TEX_MODULATION.SampleLevel(s_sampler_TEX_MODULATION, float2(vertical_angle, horizontal_angle * s_light_fov_scale), 0.0f).r); (5220,91-150): error X3014: incorrect number of arguments to numeric-type constructor hlsl 5220: light_color *= toFloat3(s_texture_TEX_MODULATION.SampleLevel(s_sampler_TEX_MODULATION, float2(vertical_angle, horizontal_angle * s_light_fov_scale), 0.0f).r); Material:"core/materials/base/render/lighting/deferred_light/lights/render_light.basemat" Material::getShader(): can't compile pass:"light_proj" material:"core/materials/base/render/lighting/deferred_light/lights/render_light.basemat" So the questions would be: Is this a bug? Does a workaround exist? => We need to use IES Profiles to get the light distribution correct and to cut the light source correctly, so it wouldn´t be a solution to just use the simple mode. Using the point light is also no preferred solution, since we would see a false shape in the reflections and other objects. Thanks in advance for any help, workaround or suggestions! Kind regards Link to comment
silent Posted September 11 Share Posted September 11 Hi Simone, Shader compilation errors could be easily fixed with attached data/core/materials/shaders/render/light/area_light.h file (core.zip). Just unpack it into the <PROJECT>/data dir and reload materials (F7): After that area lights should work fine with the IES profiles.The results I am currently obtaining with IES and the Planar Reflection Probe are as follows: Could you please confirm whether that is what you intended to achieve? Thanks! core.zip 1 How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
ShadowZelda Posted September 11 Author Share Posted September 11 Hi @silent Yes, that worked and fixed the problem. Thank you very much for the quick response! :) Kind regards 1 Link to comment
Recommended Posts