Author Topic: Fixed Light Source?  (Read 97 times)

ponut64

  • Newbie
  • *
  • Posts: 42
  • Karma: +6/-0
    • View Profile
Fixed Light Source?
« on: May 03, 2018, 06:17:43 am »
Simple question. Does anyone know how to organize a fixed light source?

It probably revolves around organizing my matrix properly, but at the moment it seems the light source is always the camera/player.
I want the light source to always be in one particular location in the world. Or rather, from one particular angle (i'm not asking it to be in the center, that would be much more complicated)

Maybe I should figure out gourad shading
« Last Edit: May 03, 2018, 06:22:27 am by ponut64 »

XL2

  • Full Member
  • ***
  • Posts: 210
  • Karma: +45/-0
    • View Profile
Re: Fixed Light Source?
« Reply #1 on: May 09, 2018, 08:56:34 pm »
You need to calculate the point.
See the SGL demos or RockinB's tutorial.

ponut64

  • Newbie
  • *
  • Posts: 42
  • Karma: +6/-0
    • View Profile
Re: Fixed Light Source?
« Reply #2 on: May 09, 2018, 11:03:15 pm »
That's helpful, now I know where to look. I guess I should have figured Sega would have a demo of such a thing, wouldn't they?

XL2

  • Full Member
  • ***
  • Posts: 210
  • Karma: +45/-0
    • View Profile
Re: Fixed Light Source?
« Reply #3 on: May 10, 2018, 12:28:25 am »
I'm not sure if that's sarcasm, but if not here is the link where RB explains it : http://www.rockin-b.de/saturn/saturngametutorial/SaturnGameTutorial.htm#useRealtimeGouraud

ponut64

  • Newbie
  • *
  • Posts: 42
  • Karma: +6/-0
    • View Profile
Re: Fixed Light Source?
« Reply #4 on: May 10, 2018, 12:52:41 am »
I'm not sure if that's sarcasm, but if not here is the link where RB explains it : http://www.rockin-b.de/saturn/saturngametutorial/SaturnGameTutorial.htm#useRealtimeGouraud

No, that wasn't sarcasm. I really didn't know where to look. Thanks, XL2
You, on the other hand, are free to call me lazy. it does mark something off of ones pride to find out the solution really was google

With gourad shading laid out so simply like that, using your CLUT (or really any other) system is made easier
« Last Edit: May 10, 2018, 01:00:23 am by ponut64 »

XL2

  • Full Member
  • ***
  • Posts: 210
  • Karma: +45/-0
    • View Profile
Re: Fixed Light Source?
« Reply #5 on: May 10, 2018, 01:05:39 am »
Yes, I recommand you use CLUT on every texture, it allows you to switch between gouraud and vdp2 effects easily.
On flat shaded quads you can easily use light effects. Look at the Akira3 SGL demo for a really nice effect (RB demo also looks great with realtime gouraud).

ponut64

  • Newbie
  • *
  • Posts: 42
  • Karma: +6/-0
    • View Profile
Re: Fixed Light Source?
« Reply #6 on: May 10, 2018, 01:18:11 am »
Well, while you're here, I do want to ask: What memory are meshes stored in?
Jo engine has a memory used function, it reports I'm using 0% with 2% fragments. I would think that's dynamic memory (not work RAM).

If I can do animation with minimal effort, its having a unique mesh for every frame of animation.
I'm worried about rapidly overflowing memory if it was the case where this meshes .h file is 48 KB, if that really does consume 48 KB of RAM, that is not very many frames of animation that can be done. I can think of ways around that (like only doing a difference between each frame rather than an entire new mesh with redundant data, or reading from CD) but... I needn't worry you about that when I have such a simple question.

I did look over jo engine C and H files trying to find a memory address there, but I could only find references in VDP1 and VDP2 ram or the extended RAM cart.

« Last Edit: May 10, 2018, 01:28:00 am by ponut64 »

XL2

  • Full Member
  • ***
  • Posts: 210
  • Karma: +45/-0
    • View Profile
Re: Fixed Light Source?
« Reply #7 on: May 10, 2018, 01:30:24 am »
You could separate your mesh in different meshes, each mesh acting as a limb/bone. Then it's just a matter of pushing/poping matrixes to animate the meshes.
Another option you be to have 1 mesh, but store multiple vertices  (si you do something like myPDATA->pntbl = &point_array1).
The main issue with that is that each verticle takes 12 bytes, so you can imagine that it would take a huge amount of memory, but still less than having full meshes.

ponut64

  • Newbie
  • *
  • Posts: 42
  • Karma: +6/-0
    • View Profile
Re: Fixed Light Source?
« Reply #8 on: May 10, 2018, 01:39:03 am »
That's a very good tip about only needing to change the vertices location, since I won't be adding any faces or edges. That brings 1 second of half-rate animation (where I really want the advantages of bones on a manifold mesh and such on a rig in Blender) down from 720 KB to a maximum of 36 KB, which is definitely manageable. Thanks again. I don't need to worry so much about how much memory it takes in that case.

XL2

  • Full Member
  • ***
  • Posts: 210
  • Karma: +45/-0
    • View Profile
Re: Fixed Light Source?
« Reply #9 on: May 14, 2018, 11:36:45 pm »

 

Sitemap 1 2 3 4 5 6 7 8 9 10 
SMF spam blocked by CleanTalk