YouGroove Posted September 29, 2015 Share Posted September 29, 2015 I updated my project and the last changes made the PBR style shader only reflect in a side of the models with a strange reflection. Quote Stop toying and make games Link to comment Share on other sites More sharing options...
Josh Posted September 29, 2015 Share Posted September 29, 2015 When decals were added I had to switch the material flags and specular values in the gbuffer. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
YouGroove Posted October 3, 2015 Author Share Posted October 3, 2015 I find that LE3 official shader "diffuse+normal+specular+env" just don't produce no environment effect at all. Quote Stop toying and make games Link to comment Share on other sites More sharing options...
macklebee Posted October 3, 2015 Share Posted October 3, 2015 Its because the default shader calculates the cubemap colors combined with the specular texture but then never does anything with that variable ('emissions'). Another thing to consider is that the texture slot for the cubemap is texture 5. Also, keep in mind that there is no default env shader for animated models. Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
YouGroove Posted October 3, 2015 Author Share Posted October 3, 2015 Another thing to consider is that the texture slot for the cubemap is texture 5 I put one on texture 5 slot , but nothing happens. I was seeking some reflective material effect for static models not animated. LE3 is not able to have buidling windows reflective like this simple shader ? How can we do ? Quote Stop toying and make games Link to comment Share on other sites More sharing options...
Josh Posted October 3, 2015 Share Posted October 3, 2015 The cubemap goes on texture slot 5, and if you change the last line of the pixel shader to this, it will appear: fragData2 = vec4(emission.rgb,specular); It just doesn't get used in the default demos, so this got missed. Adding the fixed shader now... 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
YouGroove Posted October 3, 2015 Author Share Posted October 3, 2015 I changed the last line, still the effect is very strange ad the reflections depends on the camera height or movement it makes on part reflective and another part not reflective. Is there something specific i missed ? Quote Stop toying and make games Link to comment Share on other sites More sharing options...
shadmar Posted October 3, 2015 Share Posted October 3, 2015 Edit: Josh I think calculation for reflective cubemap is wrong. line 63 and 64 : //reflectdir.y *= -1.0; //no need cubecoord = reflect(cubecoord,reflectdir); //reflect cubecoord by reflectdir not the other way around 1 Quote HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB Link to comment Share on other sites More sharing options...
YouGroove Posted October 3, 2015 Author Share Posted October 3, 2015 I applied your changes Shadmar, but the reflection is still depending on camera position Also is the reflection half mixed with diffuse map or can we control in some way how much it reflects ? Quote Stop toying and make games Link to comment Share on other sites More sharing options...
shadmar Posted October 3, 2015 Share Posted October 3, 2015 That looks like smoothing problems. What happens if you recalc normals using 35 or 50 degree angle. Quote HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB Link to comment Share on other sites More sharing options...
YouGroove Posted October 4, 2015 Author Share Posted October 4, 2015 I recalculated, but they still look bad and moving the camera the reflections still changes reflections. Quote Stop toying and make games Link to comment Share on other sites More sharing options...
YouGroove Posted October 4, 2015 Author Share Posted October 4, 2015 Another problem using a simple texture and normal map it makes artifacts depending on camera distance. I am not a shader coder, i will just wait for some tested working version. Quote Stop toying and make games Link to comment Share on other sites More sharing options...
shadmar Posted October 4, 2015 Share Posted October 4, 2015 They are reflections, they are suppose to reflect environment when you move the camera. Show me a video and your shader. Quote HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB Link to comment Share on other sites More sharing options...
YouGroove Posted October 4, 2015 Author Share Posted October 4, 2015 It is a problem with camera coordinates projection, ad we expect reflection on the whole surface. Just do like me and copy and change some developper material to test it. Quote Stop toying and make games Link to comment Share on other sites More sharing options...
YouGroove Posted October 5, 2015 Author Share Posted October 5, 2015 line 63 and 64 : //reflectdir.y *= -1.0; //no need cubecoord = reflect(cubecoord,reflectdir); //reflect cubecoord by reflectdir not the other way around It works, thank you for your help Shadmar. Quote Stop toying and make games Link to comment Share on other sites More sharing options...
YouGroove Posted October 5, 2015 Author Share Posted October 5, 2015 Some usefull modification to tweak models reflection power in the editor : Change this line of code in LE3 Environment shader to be able to control the level of reflection using the specular material adjustable value. vec4 emission = texture(texture5,cubecoord) * texture(texture2,ex_texcoords0) * materialcolorspecular ; Quote Stop toying and make games Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.