Jump to content

shadmar

Members
  • Posts

    3,618
  • Joined

  • Last visited

Everything posted by shadmar

  1. Yes you are probably right, but I wasn't really expecting this to be used as a mirror shader
  2. This works in c++ along with opengl statements in the suggestion made here:http://www.leadwerks.com/werkspace/topic/14403-request-for-cubemap-mipmap-building-to-lua/ But not in lua, unless we get a function like the one suggested or something that does the same.
  3. Unfortunately it only works if we get mipmap building for cubemaps, like this into the engine : http://www.leadwerks.com/werkspace/topic/14403-request-for-cubemap-mipmap-building-to-lua/
  4. If we could have added a function like this, it would allow us to build on-the-fly cubemaps from the running scene, allowing reflection setup for substances (if only for a one time render). But I cannot currently build mipmaps for a cubemap texture in lua, only in cpp if I add this: static int BuildCubeMipmaps(lua_State *L){ int argc = Interpreter::GetStackSize(); Texture* t; t = static_cast<Leadwerks::Texture*>(Interpreter::ToObject(1)); //texture sent from lua t->BuildMipmaps(); Leadwerks::OpenGL2Texture* gl2cubeTexture = dynamic_cast<Leadwerks::OpenGL2Texture*>(t); glActiveTexture(gl2cubeTexture->GetGLTarget()); glBindTexture(GL_TEXTURE_CUBE_MAP, gl2cubeTexture->gltexturehandle); glEnable(GL_TEXTURE_CUBE_MAP_SEAMLESS); glGenerateMipmap(GL_TEXTURE_CUBE_MAP); return 1; }
  5. if the metallic map is all black it will not do a metallic reflection, but rather a surface plastic like reflection with no colordepth. if you look under misc folder there is an billiard ball material as an example of this. You are suppose to supply textures for all cases, under the default folder there is 2x2 pixel textures for black/white/gray if you don't have one. For next iteration of this shader, environment mapping will be automatic.
  6. And env reflection is what it is. so metals with no light on them should still reflect the environment.
  7. oh could I have a look at the mat file? sounds like your missing a texture in a slot.
  8. Yes it should be up now. All examples should be included.
  9. What do you mean by rain should be better quality?
  10. I only need the glossy eightball/poolball example working with envmap without having it to be metallic. (upper right corner of the first figure)
  11. Almost there, so I'll upload the addon soon.
  12. The most used wokflow is metal/roughness (I think) metalness gives the environment reflection amount. roughness does two things spreads the light so environment reflection would be more blurred spreads the light so specular reflection from light sources would be spread/blurred . Like this: I'm not doing PBR discussion on how to correctly compute energy conservation and all that. It's not really important. But looking at some of the methods anyway on how metal and roughness workflow works. The shader I have used is not accurate PBR shader, but the results are almost similar from what I can tell Usage in Leadwerks 1. Download and install the substance addon from the workshop. [ http://www.leadwerks.com/werkspace/page/viewitem?fileid=658772226 ] WARNING, this will overwrite lighting shaders for directional, point and spotlight in order to read GLOSS However all your old materials not using substances will look almost the same so you don't need to do an all substance game if you don't want to, you can mix. 2. Export materials from tools like Substance Designer (they will fit right in) using the metalness/roughness workflow or just create your own from scratch, metals are pretty easy to do using just Leadwerks. Exports from Substance Designer should be set up like this with 7 textures: Texture Tab slot 0 (Diffuse) - diffuse/color/albedo map slot 1 (Normal) - normal map slot 2 (Specular) - roughness map slot 3 (Displace) - height map (this texture isn't used, but will be here for future use) slot 4 (Texture 4) - metal map, black is non metal, white is full metal slot 5 (Texture 5) - AO map, this is multiplied by diffuse/color, so use a white if you don't have an AO one. slot 6 (Texture 6) - ***Environment map, used for reflection and ambient, this map must have (important settings) Compression : uncompressed FilterMode : smooth Generate mipmaps, yes Clamp : X,Y,Z ps! Leadwerks default skybox doesn't contain any mipmps and source is not provided and therfore is is useless for usage with substances . ***In game environment mapping (for slot 6) Not so smooth but a possible way: http://www.leadwerks.com/werkspace/topic/11224-skybox-rendering/#entry82736 Properties Tab Usually Leadwerks created materials have Specular values set to 128,128,128,128 But we're using these for tuning/offsetting substances, so a good starting point is 255 across the board. A = modifier for ambient envmap lighting (multipled by texture value) R = modifier for the roughness value after specular is read from texture and modified by S S = modfier for the specular term (multipled by texture value) M = modfier for metalness (multipled by texture value) Usually you do not need to tune these since metal, roughness and env are all read from textures, but they are there if you want to fine tune. Shaders Tab Two choices, substance_static.shader for most models substance_anim.shader for bone animated models. Don't have Substance Designer? (neither do I) Ok, very well but I don't have Substance Designer and I need to make gold and iron. That is quite easy: Creating metals from scratch using just Leadwerks, lets make gold: Gold RGB color (google the values): Normalized = 1.000,0.766,0.336 or RGB = 255,195,86 1. Create a new material 2. Assign basic textures an all 7 slots. 0 - white.tex 1 - any normal texture 2 - black.tex 3 - - 4 - white.tex 5 - white.tex 6 - env.tex 3. Adjust diffuse color to 255,195,86,255 (gold color) and Specular to 255,220,255,255 (applying abit roughness) 4. Assign the substance_static.shader: For Iron, use same setup in textures, but these values for diffuse/specular:
  13. If you want to render your scene 6 times to get some super accurate reflections be my guest, but I'm not doing that :-) I think pre-rendered cubemaps are still the most used method.
  14. Just use the ssao.lua Don't use both. Don't use ssao.shader
  15. Non metals like wood plastic and brick (courtesy of tjheldna):
  16. SD exported metals (courtesy of ScrotieFlapWack), silver,copper,steel mats rendered in LE I will call them metal and gloss shaders, even tho they look like PBR they are not doing all the energy conservation stuff, only the gloss and reflection + ambient from cubemaps and fresnel term. Reflection and specular reflection/gloss are blurred/spread based on roughness map. Amount of environment reflection are based on metalness map. SD mats originally rendered in SD looked like this:
  17. shadmar

    Relocation

    Yeah look at that sand
  18. Does setting it recursivly work? SetMaterial(material,true)
  19. Yes, animation will only play if you use an animation (skinning) shader after import to Leadwerks.
  20. Could you post the content of the LE-material file you are using on the animated fbx model?
  21. @thehankinator : Will the waterbug (look into) vanish if you set reflection camera to MSAA=2 ? --check if we have reflection camera. self.world=World:GetCurrent() if self.rcamera==nil then for i=self.world:CountEntities()-1,0,-1 do if self.world:GetEntity(i):GetClass()==Object.CameraClass then if self.world:GetEntity(i):GetScale().y<0 then self.rcamera=self.world:GetEntity(i) tolua.cast(self.rcamera,"Camera") System:Print("..found reflection cam") self.rcamera:SetMultisampleMode(2) break end end end end
  22. Yes you can do that postprocess (20_pp_pixelate) http://www.leadwerks.com/werkspace/page/viewitem?fileid=256268930
×
×
  • Create New...