Crystal Space
Welcome, Guest. Please login or register.
December 20, 2014, 06:14:16 pm

Login with username, password and session length
Search:     Advanced search
9032 Posts in 2046 Topics by 9295 Members
Latest Member: Marioibuch
* Home Help Search Login Register
+  Crystal Space
|-+  Crystal Space Development
| |-+  Game Content Creation
| | |-+  Per-pixel lighting?
« previous next »
Pages: [1] Print
Author Topic: Per-pixel lighting?  (Read 5239 times)
Kriss
Newbie
*
Posts: 49



View Profile
« on: November 26, 2007, 05:00:48 pm »

Greetings! I have another problem. I need/want to have a well lit circle of surface under lamps with with area near them still being dark, looks like I can achieve this using per-pixel lighting, am I correct that this will be enough?
If so can somebody give me tips on how to "enable" this with this:
Code:
  <textures>
    <texture name="dd.bmp"> <file>./tex/dd.bmp</file></texture>
  </textures>

  <shaders>
  </shaders>

  <materials>
    <material name="wood"><texture>dd.bmp</texture></material>
  </materials>

  <library>./mdl/floor001.GenMeshFactory</library>

  <settings>
   <clearzbuf>yes</clearzbuf>
   <ambient red="0.4" green="0.4" blue="0.4" />
   <lightmapcellsize>32</lightmapcellsize>
  </settings>

  <sector name="level0001">
   <cullerp>crystalspace.culling.dynavis</cullerp>
   ....
    <meshobj name="_g_floor001_0_01">
     <plugin>genmesh</plugin>
      <params>
      <factory>floor001.GenMeshFactory</factory>
      <material>wood</material>
      </params>
      <move><v x="0.0" y="0.0" z="0.0" />
      <matrix><rotx>0.0</rotx><roty>-0.785398</roty><rotz>0.0</rotz></matrix>
      </move>
    </meshobj>
   
    <light name="Omni01level0001">
      <center x="0.0" y="3.5" z="0.0" />
      <radius>20</radius>
      <color red="0.9" green="1.0" blue="1.0" />
    </light>
...
  <fog red="0.3" green="0.3" blue="0.4" density="0.003" />
  </sector>

  <start name="Camera01">
   <sector>level0001</sector>
   <position x="0.0" y="2.0" z="0.0" />
  </start>

  <sequences>
  </sequences>
  <triggers>
  </triggers>
</world>
Logged
bookeater2
Newbie
*
Posts: 45


View Profile Email
« Reply #1 on: November 27, 2007, 04:44:39 pm »

The lighter2 program will draw a lit area on the textures nearby the light.
Shaders will do it but in a very different way, and it is 'realtime'.
I'm not sure from your file what you're trying.
Logged
Kriss
Newbie
*
Posts: 49



View Profile
« Reply #2 on: November 28, 2007, 01:25:31 am »

lighter2 - No such program in CELStart 1.2
shaders - can you tell what shaders I should use to achieve such result?
I tried some things but with no luck...
And that file is just a skeleton that can be used for explanation (or not), nothing more.
Logged
bookeater2
Newbie
*
Posts: 45


View Profile Email
« Reply #3 on: November 28, 2007, 04:31:02 pm »

I tried some shaders and did get an effect like that, with bumpmap or light bumpmap for example, but if there is a shader specifically for spotlight like type lighting I'm not sure, maybe someone can answer that?
Logged
Kriss
Newbie
*
Posts: 49



View Profile
« Reply #4 on: November 28, 2007, 06:42:00 pm »

But at the time can you give some successful examples?
Although of course bumpmaps is not something one would use to achieve this...
« Last Edit: November 29, 2007, 02:14:44 am by Kriss » Logged
Kriss
Newbie
*
Posts: 49



View Profile
« Reply #5 on: November 30, 2007, 01:52:01 am »

Ok I got it to work:
Code:
...
  <texture name="floor"> <file>./tex/dd.bmp</file></texture>

  <materials>
    <material name="Material0"> <texture>floor</texture></material>
  </materials>


  <plugins>
    <plugin name="renderloopLoader">crystalspace.renderloop.loop.loader</plugin>
    ...
  </plugins>

  <addon>
   <plugin>renderloopLoader</plugin>
   <paramsfile>/shader/std_rloop_shadowed.xml</paramsfile>
  </addon>

  <settings>
   <renderloop>std_rloop_shadowed</renderloop>
   <clearzbuf>yes</clearzbuf>
   <ambient red="0.4" green="0.4" blue="0.4" />
   <lightmapcellsize>16</lightmapcellsize>
  </settings>
...
But can anybody give example that's even easier on hardware? Because I need it only for 1 texture and only for static lights, or is this the only way?
I already used this
Code:
<material name="fire"><shader type="standard">std_lighting_fixed</shader><shadervar name="tex diffuse" type="texture">fire</shadervar></material>
on some of the textures where I want to haveper-vertex lighting (character too), and deleted all <localshadows /> tags, what else can be done?
« Last Edit: November 30, 2007, 02:32:02 am by Kriss » Logged
Pages: [1] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 7.397 seconds with 17 queries.