In response to reply on OpenGL matrix
0
165 Dec 30, 2013 at 04:12

It’s not something you do with a matrix. That’s down to the controls. You just don’t let the user tilt it up or down.

In response to OpenGL matrix
0
109 Dec 30, 2013 at 03:35

So how do you set such matrix to keep the camera horizontal?

In response to OpenGL matrix
1
165 Dec 30, 2013 at 03:03

I think I remember a StackOverflow question about this once. IIRC, two-point perspective is just regular pinhole perspective where you’re looking at a scene that has lots of vertical lines (like buildings, fence posts, etc), and you keep the camera horizontal, not tilting it up and down. That way vertical lines in the scene are guaranteed to be mapped to vertical lines on screen.

(You can actually still get a form of vertical camera motion by shearing the frustum up and down rather than tilting - since it keeps vertical lines vertical that way.)

The matrix for it would be the same as the regular perspective projection, since it’s just a restriction that the camera be horizontal.

In response to GLSL and different GPUs
2
165 Dec 29, 2013 at 19:54

A common trick is to hide away the version-specific stuff using macros or wrapper functions, like

#if __VERSION__ < 400
vec4 Foo(vec4 bar) { /* GL 3.x implementation */ }
#else
vec4 Foo(vec4 bar) { /* GL 4.x implementation */ }
#endif


When you compile the shader, since multiple source strings can be put in, you can put the #version directive in the first string and the rest of the source in another string. Select the correct #version for the platform you’re running on, and the preprocessor does the rest.

At my last job we used this to hide differences between HLSL and PSSL (the PS4 shading language), so we could write shaders to work in either one. It worked reasonably well.

0
102 Dec 29, 2013 at 18:03

This is how I made the integrated help system in GamePascal.

In response to reply on a new programming style
0
145 Dec 28, 2013 at 08:43

A MOB is just a Moveable Object Block, what most people now would call sprites I guess.

It was used in MOS Technology’s graphics chip literature (data sheets, etc.) However, Commodore, the main user of MOS chips and the owner of MOS for most of the chip maker’s lifetime, applied the common term “sprite”, except for the Amiga line of home computers, where MOB was the preferred term.

In response to reply on a new programming style
0
104 Dec 27, 2013 at 15:06

hmmm, well, a mob might be better, but what are they exactly?

1
102 Dec 27, 2013 at 02:05

I may use something called Jmonkey. It seems to have what I want, plus it’s commands are easier to follow.

@Override public void requestClose(boolean esc) { if (!esc){ System.out.println(“The game was quit.”); }else{ System.out.println(“Player has Collided. Final Score is “ + Score); } context.destroy(false); }”

0
102 Dec 27, 2013 at 01:41

Eh Hero doesn’t look that great, but isn’t free.. Yet cryengine/unrealengine is : /

0
101 Dec 26, 2013 at 22:53

Hope you’re having a great holiday, and are looking forward to the new year! All the best :)

0
140 Dec 26, 2013 at 21:50

If you are talking MMO, your best bet would be Hero Cloud.

In response to A voxel renderer
0
105 Dec 26, 2013 at 14:34

It is fast now (archive kept up to date until UD floored). UD is not a secret anymore.

For there is nothing covered, that shall not be revealed; neither hid, that shall not be known. (Luke 12.2)

In response to reply on a new programming style
1
145 Dec 26, 2013 at 11:04

Just think about a real game, say 100 different types of MOB’s.

Just think of what a incredible mess it would be. At least 100 if statements, and if you wanted to change something for one MOB you could accidentally change all of them.

Code maintenance would be a nightmare, debugging would be a nightmare. I see no advantages at all for this approach and hundreds of disadvantages

You can do any kind of morphing you want with much cleaner code.

MOB (Moveable Object Block) old coders should remember them

0
165 Dec 26, 2013 at 00:21

The OS is supposed to balance threads across cores by itself. It may take it a little while to get the distribution right, once you start up your threads.

It still pays to try to divide the work evenly across threads. If you have one thread doing much more work than the others, the OS can’t help you with that.

The i7 CPUs mostly have hyperthreading (2-way simultaneous multithreading) while i5 doesn’t. The OS still takes care of thread distribution though.

0
165 Dec 26, 2013 at 00:05

What do you mean by “does it work”?

Certainly you can issue a bunch of writes, but you typically have to do some kind of barrier operation to ensure that they can be seen by other CPU cores, or other devices on the system (e.g. I/O devices, or the GPU).

0
165 Dec 25, 2013 at 23:58

You can not have specular highlight with area lights using pure reflection

Yes you can. Reflected rays will hit the area light, and since it has an bright emissive color (that’s what makes it a light), that color will be reflected in the surface, forming a specular highlight.

I have no idea what you’re talking about with “the reflective part of the refraction algorithm”. Reflection is reflection. Is this something to do with Fresnel?

1
109 Dec 25, 2013 at 22:48

how would shininess work?

Only use the reflection factor of the refraction function. For example, for all your shiny materials, set an IOR value of 2 (or more if you want very shiny) and treat your material as if it was glass, except you don’t refract, only reflect. use the Russian roulette to determine when it will reflect. When you calculate the reflection and refraction, and you get say reflection=0.3 and refraction=0.7 then use a random number (0..1) and test against the reflection value, if it’s lower, do the full reflection, if higher, do nothing as if the surface was not shiny at all. Or you could reflect all the time but scale your RGB by the reflection value, i.e. RGB *= ReflectionValue to attenuate the reflection accordingly or else it’ll be a pure mirror, not shiny.

1
105 Dec 25, 2013 at 17:13

If that was true i should be at amoeba level by now

2
117 Dec 25, 2013 at 12:24

Just a reaction - I guess you’re talking about non-physically based ray tracer.

Inside physically based ray tracer you don’t actually do specular highlighting, they are naturally produced by reflectivity of the surface. Of course you have to use enough samples to create smooth highlight on semi-reflective surface -> perfectly reflective surface with black albedo (e.g. totally perfect mirror) don’t have ANY specular highlight, although in reality there is nothing like totally perfect mirror.

Just an edit, inside physically based ray tracer (or generally physically based renderer), you should use realistic model of “world” - e.g. your scene shouldn’t contain point lights and such, as point lights doesn’t exist in reality.

In response to reply on a new programming style
0
104 Dec 25, 2013 at 09:03

of course an adventure game, just imagine you create an instance from a set of conditions, not just one. and they parent each other, but there is intersecting possible, from anding two types.

so just imagine you have.

elf in forest playing guitar with fairy then fairy dances… that would be possible to insert as a special dependency.

In response to a new programming style
0
104 Dec 25, 2013 at 08:44

remember, its just continually cycling the main. whats not here is the actual spawning of the instances, im thinking of how i do that, it may be a handplaced scene, just say for now.

so, pong would be this-> (note when you add a variable, it wont run twice, only once… if it closes a condition and opens it again, then itll run it again, only when it opens a condition does it run.

and you can see, ive reused the coordinate variable for every instance. (the cool thing)

main
{
run once-> add x coordinate variable
run once-> add y coordinate variable
run once-> add instance proximity detector

if(im a bat)
{
if(key left) x--
if(key right) x++
}

if(im a ball)
{
move ball with angle condition
run proximity detector.
if(detect block proximity, using xy coordinates)
{
destroy block
mirror angle
}

if(detect bat proximity, using xy coordinates)
{
score++
mirror angle
}
}

if(im a block)
{
draw block at coordinate
}
}


so not very exciting, cause its just pong, but the strange thing you can do, is now turn a ball into a block, or a block into a bat or anything, if you wanted, during the game.

but just it has to check what it is every cycle, and thats the thing i want to fix, if you could fix that, then i would really think this way has its definite use. especially for the nonlinear adventure game… but thats when the speed issue will manifest itself.

0
104 Dec 25, 2013 at 08:35

so I guess its an approximation thing, having specular as well as reflection.

If you wanted to have pure physical specular, what variables do you need?

so far ive got, colour rgb, reflection 0-1, refraction 0-1, glossiness, ior, and… shininess?

how would shininess work?

In response to a new programming style
0
103 Dec 25, 2013 at 07:52

I’m not following. Can you give a pseudocode example?

0
105 Dec 24, 2013 at 21:56

“Merry Christmas” is anti-christian, real heathendom.

1
109 Dec 24, 2013 at 20:38

But pure reflection is still not the same. Reflection will reflect everything (or course except point lights) even the darkest of things, it’s simply a mirror. You can not have specular highlight with area lights using pure reflection, you need to use shininess derived from the reflection part of the refraction algorithm and drop the refraction part.

Say for example a white bath tub. You don’t want to make it reflective. But if you set an IOR value to it and only use the reflective part of the refraction algorithm, you’ll get proper specular highlight with area lights and bright areas of the scene and even windows, and you don’t even have to be concern with lights/sun at all. it’s purely natural.

Welcome to DevMaster, a community-driven game development website of posts and resources!

animation × 2
android × 2
indie × 2
royalty × 1
music × 1
licensing × 1
film × 1
glsl × 1
opengl × 1
linux × 1
ios × 1
audio × 1
gui × 1
contest × 1
native × 1
web × 1
testing × 1
hardware × 1
water × 1
webgl × 1
c# × 1