Wednesday, November 23, 2011
Friday, November 18, 2011
Game Engine
A game engine is a framework that used to make up a video game. It consists of different systems:
Input
Rendering
- Resource management
- Scene management - statement management, LOD, game updates, optimizing assets, geometry culling, etc.
- Game update - AI characters update, physics and collision detection, etc.
- Optimizing assets - compressing textures, reducing texture resolution, index geometry, dynamic branching for early-out execution, etc
- Geometry culling - occlusion culling, view frustum culling, geometry partitioning, etc
Sound
- Sound effects, ambient sounds, musics tracks, speech
- AI - situation-based audio
Scripting
- AI - animation paths, situational animations, etc
- Level editor
- Material editor
Physics
- Geometry collisions - point, rigid, soft masses
- Friction / drag / lift / buoyancy support for various objects
Cinematic System
- Real-time cut-scenes - move objects and the camera along predefined paths to tell part of a story
- key-frame animation, skeleton animation, etc.
Networking
- Multiplayer gaming
- Downloading game fixes, additional contents, or entire game, etc.
- Statistics tracking
Core
- Various data structures - geometry partitioning (octrees, quad trees, BSP trees, portals, scene graphs, etc), arrays, link lists, stacks, queues, hash tables, trees (binary, k-dimensionals, etc), graphs, etc.
- Common game math such as vectors, matrices, quaternions, bounding volumes, rays, and planes.
- Timers
- Memory management
- Resource management - keep track of shared resource, e.g. sound, textures, etc
- Journaling services
- File logging
- Application profilers
- Depreciation facilities
- Compression / decompression algorithms
- Encryption / decryption algorithms
Wednesday, November 9, 2011
CD & Laser Optics
A CD is made from polycarbonate plastic. The program area is 86.05 cm².
- 1.2 millimetres (0.047 in) thick and weighs 15–20 grams.
- Pit size is ~100 nm deep by 500 nm wide, 850 nm to 3.5 µm in length.
- Distance between the tracks, the pitch, is 1.6 µm.
- The length of the recordable spiral is (86.05 cm2 / 1.6 µm) = 5.38 km.
- Scanning speed of 1.2 m/s. Playing time is 74 minutes, or 650 MB of data on a CD-ROM.
- CD uses 780 nm (near infrared) semiconductor laser
- Binary data representation uses non-return-to-zero, inverted method - a change from pit to land or land to pit indicates a one, while no change indicates a series of zeros.
- Data encoding / decoding uses eight-to-fourteen modulation - data to be stored is first broken into 8-bit blocks (bytes). Each 8-bit block is translated into a corresponding 14-bit codeword using a lookup table.
- Error detection and error correction uses cross-interleaved Reed-Solomon code (or CIRC) - adds to every three data bytes one redundant parity byte.
DVD & Blu-ray
- DVD pit size is 400nm. Blu-ray pit size is 150nm.
- DVD track pitch is 740 nm. Blu-ray track pitch is 320 nm.
- DVD uses 650 nm red laser. Blu-ray Disc uses 405 nm "blue" (actually in violet range) laser directly (without frequency doubling or other nonlinear optical mechanisms) from GaN (gallium nitride) laser diodes.
Laser Optics:
The optics may include a collimating lens, diffraction grating (to produce the three beams in a three beam pickup), beamsplitter prism or mirror, turning mirror (for horizontally mounted optics), and focusing (objective) lens.
Typical CD laser optics put out about 0.3 to 1 mW at the objective lens though the diodes themselves may be capable of up to 4 or 5 mW (max). For the Blu-ray player, the output power is 40mW - 100mW. Blu-ray burner uses higher power, its output is over 500mW.
The minimum "spot size" on which a laser can be focused is limited by diffraction, and depends on the wavelength of the light and the numerical aperture of the lens used to focus it. By decreasing the wavelength, increasing the numerical aperture from 0.60 to 0.85, and making the cover layer thinner to avoid unwanted optical effects, the laser beam can be focused to a smaller spot, which effectively allows more information to be stored in the same area.
Blue laser pointers have the same basic construction as DPSS (Diode-pumped solid-state) green lasers. They emit light at 473 nm (sometimes reported as 474 nm), which is produced by frequency doubling of 946 nm laser radiation from a diode-pumped Nd:YAG or Nd:YVO4 crystal. The principal wavelength of Neodymium-doped crystals is 1064 nm. With proper reflective coating mirrors, it can be made to lase at other non-principal neodymium wavelengths, such as the 946 nm. As with green DPSS lasers, use of a 1000 mW IR diode usually results in approximately 300 mW of visible blue light.
For high output power BBO (Beta barium borate (β-BaB2O4)) crystals are used as frequency doublers; for lower powers, KTP (Potassium titanyl phosphate (KTiOPO4)) is used. Output powers available are up to 1000 mW, but this usually is the total output including the infrared.
A few higher-powered (120 mW) 404–405 nm "violet" laser pointers have become available which are not based on GaN, but uses DPSS frequency-doubler technology starting from 1 watt 808 nm gallium arsenide infrared diode lasers being directly doubled, without a longer-wave neodymium laser interposed between diode laser and doubler-crystal. As with all high powered lasers, such devices are able to pop balloons and light matches.
Tuesday, November 8, 2011
Freezing Temperature of Icewine & Freezing Distillation
The extent of freezing point depression depends only on the alcohol concentration, for small concentration, the value can calculated by the equation: ΔTF = KF · m · i , where
ΔTF = TF (pure solvent) - TF (solution) = TF (water) - TF (wine)
KF = cryoscopic constant, for water = 1.853 K·kg/mol
m = molality (mol solute per kg of solvent)
i = van 't Hoff factor (number of solute particles per mol), for alcohol i = 1.
Molar mass (g/mol) of alcohol (ethanol), CH3–CH2–OH
= 2 x 12.0107 + 5 x 1.00794 + 15.9994 = 46.06844 g/mol
For ice wine of 6% of alcohol, per 100g of wine
the mole of ethanol = 6/46.06844 = 0.13024
the mass of water = 0.094 kg
molality, m = 0.13024/0.094 = 1.38553
TF (wine) = 0 (=-273K) - 1.853 x 1.386 x 1 = -2.568°C
Freeze distillation
A process of enriching a solution by partially freezing it and removing frozen material that is poorer in the dissolved material than is the liquid portion left behind. Such enrichment parallels enrichment by true distillation, where the evaporated and recondensed portion is richer than the liquid portion left behind. Freeze distillation is a kind of partial crystallization of liquid.
The best-known freeze-distilled beverages are applejack and ice beer. Ice wine is the result of a similar process, but in this case, the freezing happens before the fermentation, and thus it is sugar, not alcohol, that gets concentrated.
However, thermodynamics (eutectic system) shown that,
- unless the removal of solid material carries away liquid, the degree of concentration will depend on the final temperature rather than on the number of cycles of removing solid material and chilling
- even if temperatures somewhat below the freezing point of ethyl alcohol are achieved, there will still be alcohol and water mixed as a liquid, and
- at some still lower temperature, the remaining alcohol-and-water solution will freeze without an alcohol-poor solid being separable
Notes:
1. Ethanol also called ethyl alcohol, drinking alcohol, or grain alcohol, is a straight-chain alcohol. Its molecular formula is C2H5OH. Ethanol is often abbreviated as EtOH, using the common organic chemistry notation of representing the ethyl group (C2H5) with Et. Freezing point is -114°C and boiling point is 78°C.
2. Colligative property - consider solvent freezes to a very nearly pure crystal. This typically occurs simply because the solute molecules do not fit well in the crystal, i.e. substituting a solute for a solvent molecule in the crystal has high enthalpy. For dilute solution, the freezing point depression depends solely on the concentration of solute particles, not on their individual properties. The explanation for the freezing point depression is then simply that as solvent molecules leave the liquid and join the solid they leave behind a smaller volume of liquid in which the solute particles can roam. The resulting reduced entropy of the solute particles thus is independent of their properties.
3. This approximation ceases to hold when the concentration becomes large enough for solute-solute interactions to become important. In that regime, the freezing point depression depends on particular properties of the solute other than its concentration.
4. Through the procedure called cryoscopy, a known constant can be used to calculate an unknown molar mass.
5. van 't Hoff factor is a measure of the effect of a solute upon colligative properties, such as vapor pressure, osmotic pressure and freezing point depression. i = the actual number of particles in solution after dissociation ÷ the number of formula units initially dissolved in solution. Means the number of particles per formula unit of the solute when a solution is dilute. For ideal solutions, i is essentially 1 for most non-electrolytes dissolved in water, e.g., Glucose in water. For most ionic compounds dissolved in water, the van 't Hoff factor is equal to the number of discrete ions in a formula unit of the substance, e.g., i=2 for NaCl.
Subscribe to:
Posts (Atom)