1 registered members (AndrewAMD),
552
guests, and 1
spider. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Lighting Question
#475318
12/01/18 19:33
12/01/18 19:33
|
Joined: Jan 2006
Posts: 245 PA
Garrettwademan
OP
Member
|
OP
Member
Joined: Jan 2006
Posts: 245
PA
|
So I have been beating my head over this, can anyone tell me why my light cast is acting this way on the models? The ceiling tile and floor is 1 model, but it has multiple faces and the light appears different at each face having its own local light scheme. Looking to see if I can make this look more realistic. Any thoughts? FYI - I have almost no code to handle this today, so I am open to ideas on how to start on this.
Last edited by Garrettwademan; 12/01/18 19:45.
|
|
|
Re: Lighting Question
[Re: Garrettwademan]
#475319
12/01/18 19:53
12/01/18 19:53
|
Joined: May 2009
Posts: 5,370 Caucasus
3run
Senior Expert
|
Senior Expert
Joined: May 2009
Posts: 5,370
Caucasus
|
Hi there! I guess only per pixel lighting will fix this issue. By default acknex uses vertex lightning as far as I know. So the best way to fix that, is to use shaders (to write it by yourself, cause I can't really recall a 'ready-to-use' solution for that Edit: I guess those bumpmapping shaders from AUM or free resource page are having per pixel lightning). Edit: also, face-separation might help. I remember something about this from Superku, will try to find now. Edit2: I couldn't find it.. so here I've made some screen shots to show what I meant by face-separation: 1 - this is a simple 'smooth' box created in MED, it will have some lightning issues (same as on your screenshot). 2 - select one of it's sides (f.e. the top as on this picture) and press COPY (near by the OPEN, SAVE etc) 3 - after copying it, remove the side (press delete) 4 - press PASTE button which is right next to COPY, and you'll get separated top side of the box 5 - continue with the rest 5 sides, and you'll get a box with separated faces This will help to get more or less proper lightning, but per pixel lightning shader is MUST have too (combined with this tips). Edit3: also, you can see differences between vertex lightning (only looks good on more or less high polygon models/surfaces) and per pixel lightning on this videos Vertex Lighting BDX Devlog #2 - Per-Pixel Lighting Best regards.
Last edited by 3run; 12/01/18 20:15.
|
|
|
Re: Lighting Question
[Re: Garrettwademan]
#475706
01/04/19 14:00
01/04/19 14:00
|
Joined: Sep 2003
Posts: 6,861 Kiel (Germany)
Superku
Senior Expert
|
Senior Expert
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
|
Np, glad it's helping you out! Outline: Fullscreen outlines for all geometry via postprocessing is rather easy, might work for a single object as well (via a mask/ MRTs). The easiest way would be to create a duplicate of your model but where you weld all close-by vertices (again), then create a shader where you offset all vertices by the vertex normal direction times some factor. (You can do this in let's say Blender as well, scale in normal direction, but via shader you could let's say animate it slightly or change the offset based on the distance to the camera.) Btw. you should start looking into some shaders for reflective materials, for a semi shiny reflective floor, for dynamic highlights on metal and all that good stuff. I'm not necessarily talking about actual real time reflections but you could try that as well. I use shaders for everything and most of the time sample a simple highlight texture based on the view transformed normals, which makes objects look more dynamic and not as pre 1999. I use that for example for subtle highlights on characters or to give a flat greyscale object a metallic look of sorts. Regarding reflective materials, here's something I made and recorded a few weeks ago (first 10seconds or so): https://i.gyazo.com/6443ca1228cb2d7571e5dd960973ae3b.mp4It's over the top of course but shows how basic textures can be transformed into something else not via artistic skills but some coding.
"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual Check out my new game: Pogostuck: Rage With Your Friends
|
|
|
Re: Lighting Question
[Re: Garrettwademan]
#475729
01/05/19 16:25
01/05/19 16:25
|
Joined: Sep 2003
Posts: 6,861 Kiel (Germany)
Superku
Senior Expert
|
Senior Expert
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
|
Hehe. Well, I haven't used C-Script in 11 years or whenever lite-C came along, but looking at the Gamestudio Wiki you can use regular DX9 shaders with it. Apparently, the postprocessing works the same as well, which is good. Slin made some shader tutorial videos many years ago, I watched them but didn't get much from them (nonetheless they were my start into the world of shaders, so thanks for that!). You only need to understand the basic concept of rendering with shaders, everything else is straightforward (more or less) and learning by doing from there on. For each vertex a vertex shader function is executed. It uses input such as position, texture coordinates, normals, does some calculations with them and writes the results in some registers. For every pixel on screen (not a texture pixel) when drawing a triangle a pixel shader function is executed where you can grab interpolated information from the 3 vertices (and vertex shader results) making up the triangle. On a very basic level this might be interpolated texture coordinates which you can use to sample a texture, for color, normal maps and all that good stuff. Oh, there's an official tutorial I forgot: http://www.conitec.net/shaders/Read "Introduction", "The D3D Pipeline", Workshop 1,2,5 for a start. I have a default shader similar to the one from Workshop 2 and use it as a basis for most new shaders, no need to write it a new each time.
"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual Check out my new game: Pogostuck: Rage With Your Friends
|
|
|
Re: Lighting Question
[Re: jumpman]
#475749
01/06/19 16:44
01/06/19 16:44
|
Joined: Sep 2003
Posts: 6,861 Kiel (Germany)
Superku
Senior Expert
|
Senior Expert
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
|
Thank you! I'm rendering all lights (views) into a single 16bit shadow atlas texture, as in DOOM (2016) (and probably many/ most other game): My render/ lighting pipeline is not finished yet though, currently the number and types of lights are hardcoded into a single pass. I want to make a quad based deferred renderer (for the lights) if that makes sense. That is let's say divide the screen into 8x6 quads, then calculate for each quad lights which touch the extruded quad volume in screen space and then process that quad with a custom bmap_process function. The latter is already implemented, for the most part at least, and allows to execute a pixel shader for sections of the target bitmap - which in my case could be a 16 bit HDR light color map, we'll see.
"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual Check out my new game: Pogostuck: Rage With Your Friends
|
|
|
Re: Lighting Question
[Re: jumpman]
#475781
01/07/19 19:40
01/07/19 19:40
|
Joined: Sep 2003
Posts: 6,861 Kiel (Germany)
Superku
Senior Expert
|
Senior Expert
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
|
Haha there's still quite a few differences between DOOM's and my rendering but... thanks. Yeah they have some good stuff in there, and it's nice of them to share it with us folks.
"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual Check out my new game: Pogostuck: Rage With Your Friends
|
|
|
|