chg Posted November 30, 2015 Share Posted November 30, 2015 why dont use frensel for that ? http://www.babylonjs.com/cyos/#2KUJ1TIf you're goal is just to shade the fragments that are almost at a tangent to the view surely ramping/thresholding a rim shader would make more sense than messing with Shlick's approximation of the Fresnel term? I was actually playing with a rim shader recently and I'm very much a noob but I managed to move half of it back into the vertex shader and have it still look ok (I think). Well for not for a flat shaded low poly cube, but I'm guessing the Fresnel effect doesn't give that nice outlines either right? You kind of assume smooth continuous contours if you expect your Fresnel highlights to be an edge right? Regarding doing edge's with geometry, now that you have a way to clone a mesh to separate geometry, I think if you can renormalise it so it is all smooth (ie. no caps on the cylinders) before you push it out along the normals* it will solve the issue you had in the earlier PGs (sorry if you already figured this out, thought I'd mention it though as I wasn't sure... am not a Babylon user so I don't know 100% that recalculating the normals will smooth the cylinder caps and cube edges so this advice comes untested, but if you verts are all shared you shouldn't get the breaks in the outlines you were seeing earlier)*nevermind, I see you are just scaling the mesh not doing anything with the normals Quote Link to comment Share on other sites More sharing options...
iiceman Posted November 30, 2015 Author Share Posted November 30, 2015 Hi chg, sounds like you know a thing or two about shaders and mesh, but you are not a babylon user? O_o Why not!? [...] I was actually playing with a rim shader recently [...]Show us! I still assume there is an awesome solution with shaders for the outline thing and I am pretttyyyy sure somebody around here can do it. I am just beeing patient and wait untill somebody does it for me and in the meantime I try to find a working alternative that I can somehow comprehend with my current knowledge I think the version with the cloned mesh and the copied geometry is already pretty good, I try it out a bit more tonight and let you guys know how it went. Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted November 30, 2015 Share Posted November 30, 2015 i can make outline by shader 1. we need make a mesh bigger than old mesh ** best way : newpos = oldpos + normal*len; in case : vec4 outPosition = worldViewProjection * vec4(position+normal*0.3, 1.0) 2. just discard inside and show oldMesh http://www.babylonjs.com/cyos/#2KUJ1T#1 compare 2 mesh you see the new mesh have old mesh inside and just show outline with any material you want. Vousk-prod. 1 Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted November 30, 2015 Share Posted November 30, 2015 i can append this in to babylon js material like OutLineMaterial just look that and say me to do it. http://185.88.152.45/sample discard outline ::: alpha OutLine :::: Orginal Mesh iiceman, jerome, MarianG and 1 other 4 Quote Link to comment Share on other sites More sharing options...
iiceman Posted November 30, 2015 Author Share Posted November 30, 2015 It's not exactly what I imagined for the outline, but it's super cool! It looks like a force field or something like that. If you can make it into a material you can still participate in the November challenge with it, I am sure that material would be useful somehow! By the way: I like the second one from the right best Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted November 30, 2015 Share Posted November 30, 2015 thank iiceman i know what you want . i think you can build that only by postprocess . Quote Link to comment Share on other sites More sharing options...
iiceman Posted December 1, 2015 Author Share Posted December 1, 2015 By the way, here is the current use case for the outline thingy: http://p215008.mittwaldserver.info/mapEditor2.0/MapEditor/ I restarted the simple editor that I planed to make for a long time now. I decided to strat from scratch again and use angular for the UI. The idea is to generate the interface dynamically based on the attributes for each object. Therefor I store only the data that I want to make editable in a json file. One for general mesh options and properties: http://p215008.mittwaldserver.info/mapEditor2.0/MapEditor/data/abstractMeshBlueprint.jsonAnd one for mesh specific stuff: http://p215008.mittwaldserver.info/mapEditor2.0/MapEditor/data/meshBlueprints.json Same for materials (still working on that - maybe I can steal some stuff from raananWs material editor http://materialeditor.raananweber.com/ ... or even import stuff created there). The goal is that I only need to edit the json file to add new meshes (custom mesh, too later on) and get a super simple editor to place some meshes and give them materials on the go. If that all works I try to save that as a babylon file and add some more features to improve the editor. But so far babylon and angular work together great! (And the selection looks cool, too, except for the plane. I guess I have to do it differently for the planes). MasterK 1 Quote 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.