Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/18/24 10:45
StartWeek not working as it should
by Zheka. 04/18/24 10:11
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 552 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, 11honza11, ccorrea, sakolin, rajesh7827
19046 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Lighting Question #475318
12/01/18 19:33
12/01/18 19:33
Joined: Jan 2006
Posts: 245
PA
Garrettwademan Offline OP
Member
Garrettwademan  Offline 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.

Current Project: Computer Repair Simulator
https://www.computer-repair-simulator.com
Re: Lighting Question [Re: Garrettwademan] #475319
12/01/18 19:53
12/01/18 19:53
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline
Senior Expert
3run  Offline
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).
Quote:
#1

#2

#3

#4

#5



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.

Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: Lighting Question [Re: 3run] #475320
12/01/18 20:14
12/01/18 20:14
Joined: Jan 2006
Posts: 245
PA
Garrettwademan Offline OP
Member
Garrettwademan  Offline OP
Member

Joined: Jan 2006
Posts: 245
PA
You guys got it! Thanks.



Current Project: Computer Repair Simulator
https://www.computer-repair-simulator.com
Re: Lighting Question [Re: Garrettwademan] #475321
12/01/18 20:17
12/01/18 20:17
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
Glad to be helpful! Thanks to Superku, I've learned all those awesome tips from him! laugh


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: Lighting Question [Re: 3run] #475323
12/02/18 07:22
12/02/18 07:22
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
@3run: Good avice/ post! wink
My pic you were probably looking for - from January 2013, took me a while to find it:



"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: Superku] #475348
12/03/18 16:25
12/03/18 16:25
Joined: Feb 2003
Posts: 146
RP China
2
20BN Offline
Member
20BN  Offline
Member
2

Joined: Feb 2003
Posts: 146
RP China
You can import *.obj in "Model from FBX 2010" fix all smooth group.

Re: Lighting Question [Re: 20BN] #475698
01/04/19 03:33
01/04/19 03:33
Joined: Jan 2006
Posts: 245
PA
Garrettwademan Offline OP
Member
Garrettwademan  Offline OP
Member

Joined: Jan 2006
Posts: 245
PA
I see what you did, you basically have a model that has welded vertices connecting more than 1 plane facing different directions etc, and you copied the specific faces, and re pasted so its on its own group, and then delete the original, thus removing the shared vertices....right? BRILLIANT. I think you now taught me what the heck has been going on with my models over the years lol.

I have focused my entire career to coding and getting a game to a functional point...now that I am here I am learning so much about the finishing touches. I still need to learn shaders and special edge blending lol.

This is probably way off topic, but if anyone has tried this, it would be you Superku. Is there a way to make like a light outline around a certain model? Say for instance in your model above, if you wanted to have a red outline around the model outside edges, does this game engine support such a thing?


Current Project: Computer Repair Simulator
https://www.computer-repair-simulator.com
Re: Lighting Question [Re: Garrettwademan] #475699
01/04/19 04:46
01/04/19 04:46
Joined: Jan 2006
Posts: 245
PA
Garrettwademan Offline OP
Member
Garrettwademan  Offline OP
Member

Joined: Jan 2006
Posts: 245
PA
So I spent the last hour following your steps on some of my main models....and WOWZER! Amazing overhaul to my output with so little work. FYI Tonight I learned to link the keyboard hotkeys in MED haha, I had no idea this worked in the A8 MED, been using a very old MED I just found out too.

Check this out, THANK YOU AGAIN!!



Current Project: Computer Repair Simulator
https://www.computer-repair-simulator.com
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 Offline
Senior Expert
Superku  Offline
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.mp4
It'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: Superku] #475719
01/05/19 00:38
01/05/19 00:38
Joined: Jan 2006
Posts: 245
PA
Garrettwademan Offline OP
Member
Garrettwademan  Offline OP
Member

Joined: Jan 2006
Posts: 245
PA
That is really good advice. I got as close as considering duplicating my model and always having it slightly bigger behind the original and make it like an all in 1 color, but it would have to move around the camera and I think I have too many items to handle for this. That is okay but wanted to make sure it wasn't something super easy.

As for my shaders, I use 0 now (I use 1 to make an item all white lol). I will watch your video because I think having some fake reflections could do a lot of good, along with some object shaders. I know it can be done, I just have to focus on it. I will go back and do some reading on the tutorials as well. Now that the main code is done in my project, I can now begin to look at this stuff. My thought before hand was if I have no code, there is no point to having good models. I can't say that now.

I know this forum has some good stuff too, I plan on going through it for final touches.


Current Project: Computer Repair Simulator
https://www.computer-repair-simulator.com
Re: Lighting Question [Re: Superku] #475721
01/05/19 02:07
01/05/19 02:07
Joined: Jan 2006
Posts: 245
PA
Garrettwademan Offline OP
Member
Garrettwademan  Offline OP
Member

Joined: Jan 2006
Posts: 245
PA
Okay so I watched your over the top demo of your shaders and now I am shaking with excitement literally, like my mind is racing on what I just saw. Okay so question, I am using C-Script, what am I limited to on the shaders I just saw? I feel like since I am using C-Script and now Lite-C I am limited.

Second question, how in the heck did you learn how to do those shaders? Do you have a learning source so I can look into this and start getting into trouble?

You have just boggled my mind by the way.


Current Project: Computer Repair Simulator
https://www.computer-repair-simulator.com
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 Offline
Senior Expert
Superku  Offline
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: Superku] #475745
01/06/19 14:19
01/06/19 14:19
Joined: Apr 2002
Posts: 1,246
ny
jumpman Offline
Serious User
jumpman  Offline
Serious User

Joined: Apr 2002
Posts: 1,246
ny
@superku

Excellent work! How did you get multiple shadow casting lights?

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 Offline
Senior Expert
Superku  Offline
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: Superku] #475775
01/07/19 18:34
01/07/19 18:34
Joined: Apr 2002
Posts: 1,246
ny
jumpman Offline
Serious User
jumpman  Offline
Serious User

Joined: Apr 2002
Posts: 1,246
ny
WOW. All I can really say.

I love doom, and saw many talks and PDF's about their rendering and animation process, but here you are actually doing it. I think Conitec should hire you.

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 Offline
Senior Expert
Superku  Offline
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. wink
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
Page 1 of 2 1 2

Moderated by  HeelX, Spirit 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1