Jump to content

Recommended Posts

Posted

When decals were added I had to switch the material flags and specular values in the gbuffer.

My job is to make tools you love, with the features you want, and performance you can't live without.

Posted

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.

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

Posted
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 ?

Stop toying and make games

Posted

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...

  • Upvote 1

My job is to make tools you love, with the features you want, and performance you can't live without.

Posted

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 ?

post-3271-0-41545800-1443909599_thumb.jpg

post-3271-0-07542800-1443910412_thumb.jpg

Stop toying and make games

Posted

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

  • Upvote 1

HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB

Posted

I applied your changes Shadmar, but the reflection is still depending on camera position sad.png

Also is the reflection half mixed with diffuse map or can we control in some way how much it reflects ?

post-3271-0-14865500-1443914403_thumb.jpg

Stop toying and make games

Posted

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.

post-3271-0-45780900-1443954998_thumb.jpg

Stop toying and make games

Posted

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.

post-3271-0-83173800-1443968540_thumb.jpg

Stop toying and make games

Posted

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.

post-3271-0-28768200-1444062677_thumb.jpg

Stop toying and make games

Posted

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 ;

post-3271-0-65273800-1444068177_thumb.jpg

Stop toying and make games

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...