Mark Sibly

Forum Replies Created

Viewing 15 posts - 661 through 675 (of 1,431 total)
  • Author
    Posts
  • in reply to: Sky plane #9225

    Mark Sibly
    Keymaster

    Not as yet – the skybox is currently implemented by a simple quad+custom shader.

    in reply to: Mojo3D PBR material "glows in the dark" #9224

    Mark Sibly
    Keymaster

    Shouldn’t the roughness affect how “blurry” the environment seems?

    The ‘roughness’ controls which miplevel of the env cubemap is fetched when doing the reflection effect – higher roughness=blurrier mipmap used. But I agree your highlight looks wrong – there should probably be some filtering going on, it looks a bit too ‘binary’ to me.

    There are other complications though. There’s no easy way to tell what miplevel the GPU would pick (which I need to know too) so that gets encoded in the cubemap alpha channel. But even then, GPU can apparently pick a mip level<0, but I have no way of knowing if it did as it gets clamped to 0. So there’s some dodgy add/sub hackery going on around that which affects output at the limits of ‘roughness’, some of which may just not be solvable in plain gles20 glsl.

    Can you post the exact code you used to get your result?

    in reply to: Mojo3D PBR material "glows in the dark" #9220

    Mark Sibly
    Keymaster

    Had a bit more of a play with this, and you can indeed disable the ambient specular lighting like this:

    This creates a 1×1 black cubemap and assigns it to the scene’s EnvTexture (not SkyTexture, my bad).

    This will disable specular env reflections too though, pretty much as if you taped black paper over the windows (not recommended)!

    in reply to: terrain – Release and Debug mojo3d diferent behaviour. #9219

    Mark Sibly
    Keymaster

    The scene Terrain stack is internal and may yet change – using Entity.Destroy() is the correct way to remove something from a scene (assuming it works!).

    There are many internal/experimental features like this. When in doubt, consult the docs, all the internal stuff should be hidden.

    It’s probably about time to add a real ‘Internal’ directive to the language…

    FFS, I’m making a lot of rookie mistakes lately I’m just about ready to quit coding forever…

    Well, it’s not like any of this is particularly well docced!

    in reply to: Request – Mojo3d – Addtriangle example #9218

    Mark Sibly
    Keymaster

    Just added this to tests!

    The easiest way to go is to create an array of vertices and an array of indices and just use New Mesh( vertices,triangles ).

    Also, have a look at the source code for Mesh.CreateBox, Mesh.CreateSphere etc in modules/mojo3d/graphics/meshprims.monkey2

    in reply to: Quake BSP loading #9213

    Mark Sibly
    Keymaster

    Looks very quake-y, love it!

    in reply to: lots of errors in both important tutorials #9209

    Mark Sibly
    Keymaster

    >  “Attempt to invoke method on null instance”

    Ah yes, this is new to 1.1.05. It used to be you could invoke a (non-virtual) method on a ‘null’ object, but this is now caught by the debugger at runtime, eg:

    This *used* to be allowed in monkey2, but in 1.1.05 and later you will get the above error.

    The debugger *should* show you where it’s happening?

    in reply to: terrain – Release and Debug mojo3d diferent behaviour. #9208

    Mark Sibly
    Keymaster

    Had me going for a while, but the main problem here is that pixmaps are not cleared by default.

    Add a pm.Clear( Color.Black ) after the New Pixmap(…).

    in reply to: Mojo3D PBR material "glows in the dark" #9206

    Mark Sibly
    Keymaster

    This is due to the default SkyTexture, which effectively ’emits’ light (so SkyTexture is really kind of an ‘ambient specular’ map). The material’s specular reflection factor here is derived from its metalness, but this is never quite 0 because everything is shiny:

    http://filmicworlds.com/blog/everything-is-shiny/
    http://filmicworlds.com/blog/everything-has-fresnel/

    There are at least a couple of solutions here: you could use a ‘black’ SkyTexture which would totally eliminate any ‘ambient specular’ component (and totally eliminate any specular reflection effects – like in a completely dark room). I guess I could also add an ‘AmbientSpecular’ factor too that you could set to Black to do the same thing.

    But I suspect what you really want is a custom type of non-pbr material that can be fudged however you want, without elimintaing specular reflections from the entire scene? I will probably be doing something like this myself soon as not everyone wants ‘realistic’ PBR style lighting – lots of people will no doubt just want matte/old school materials.

    Also, I need a *better* default SkyTexture – the current one is too obviously a ‘sky/desert’ scene! If anyone has anything (in skybox format…) please let me know. I think a plain color gradient from sky to dirt might look best, but in skybox format.

    in reply to: lots of errors in both important tutorials #9205

    Mark Sibly
    Keymaster

    This is when you use methods in a class and using no class variables(I think) It needs you to change the reported methods to functions.

    Can you post an example of this?

    in reply to: MX2 apps more intensive when minimized? #9204

    Mark Sibly
    Keymaster

    This’ll be due to the deferred renderer ‘thrashing’ without any vsync – since it always renders to a texture, rendering never ‘fails’ the way it would if it was rendering to a window. Will fix.

    in reply to: Multiple materials per model #9162

    Mark Sibly
    Keymaster

    …also, each Model has a ‘default material’ property called Model.Material. This is used if there aren’t enough materials in the model’s Materials array to render the mesh with, so is very convenient if you just want to render a mesh with a single material etc, ie: just use Model.Material instead of Model.Materials.

    in reply to: Multiple materials per model #9161

    Mark Sibly
    Keymaster

    Use Mesh.AddMaterials( count:Int ) to add materials to a mesh, and use the ‘materialid’ parameter (defaults to 0) of Mesh.AddTriangles() to add triangles to a particular material.

    A mesh starts with one material (with id=0), so first material you add will have id=1, next will have id=2 etc.

    But meshes don’t actually store physical material instances, just the triangles assigned to each material ‘id’. Materials are actually stored in the Model entity (that also stores the mesh) via the Model.Materials property.

    So the basic idea is:

    in reply to: Metal Rough Spheres example #9155

    Mark Sibly
    Keymaster

    Also, any chance you can send me the (quake?) mesh you’re using?

    in reply to: Metal Rough Spheres example #9154

    Mark Sibly
    Keymaster

    Can’t spend any time on this right now, just collecting info…

    It looks like a shadows issue to me, but there’s currently no way to turn them off. Also, the shadow technique used is designed for large scale outdoors scenes and will not work too well indoors (but it should still work…).

    A lot of the flickering on the indoor scene is likely to be due to the fact the light is pointing straight down so is ‘grazing’ the vertically oriented walls which is resulting in numerical ‘epsilon’ problems. Try rotating the light a little bit! There are various fudge factors that can help with these problems, but I haven’t explored them much. I will make them easier to play with in the next release.

    There is still a LOT of work to do so don’t expect too much at this point. It all works well on *my* machines, but there is a lot of different 3d hardware around and it wont work the same on everyone’s. My guess would be your depth textures have a lower precision than mine, which, if true, means you *will* get lower quality shadows, but of course things shouldn’t flicker like crazy.

    Quick idea: you can disable shadows for now by changing ‘float shadow=evalShadow();’ to ‘float shadow=1.0;’ in modules/mojo3d/graphics/shaders/directional-light.glsl. Can you try this and post another screenshot, preferably from above, looking down on the scene? Since light is pointing down (and there’s no global illumination!) an ‘underneath’ shot is only showing ambient lighting.

Viewing 15 posts - 661 through 675 (of 1,431 total)