Jump to content

  • Log In with Google      Sign In   
  • Create Account

JohnnyCode

Member Since 10 Mar 2008
Offline Last Active Yesterday, 11:08 AM

#5202728 htaccess url override

Posted by JohnnyCode on 07 January 2015 - 08:34 PM

Hi.

 

I need to override this simple constant url

 

domain.dom/somedir

 

to

 

domain.dom/somedir/doc.php?const=const1

 

 if I type domain.dom/somedir nothing happens, I have two following problems

 

1- should I write rule for domain.dom/somedir as well as www.domain.dom/somedir ?

 

2- can I redirect to domain.dom/somedir/doc.php?const=const1, or it will have to be www.domain.dom/somedir/doc.php?const=const1?

 

My .htaccess file is lpaced correctly becouse mime types in it are working

 

[EDIT] so I just followed and inspected rules a bit more, and I have done it




#5202146 do most games do a lot of dynamic memory allocation?

Posted by JohnnyCode on 05 January 2015 - 10:27 PM

There is a difference over fragmenting OS requested process memory over time in naive way, and there is difference about being an obsesed happye programmer of "any time alloquance" of a variable that c++ came to offer. I as a programmer would never give up the feuture of requesting memory on runtime of program, but as I grew bigger and older, I realized one should be spare in this




#5201538 do most games do a lot of dynamic memory allocation?

Posted by JohnnyCode on 03 January 2015 - 09:34 AM

 

 

Not using the heap as a defensive strategy against bad coding doesn't seem like valid thinking to me.


That not being the main reason , though pretty reasonable reason. If you do not free memory to the very OS, you can implement :
1- pooling
2- cache rapid friendship
3- reordering in memory layout
4- reindexing

C# hiddenly implement those, that is how much those mentions are benefitial at runtime

Could you explain why you think you can do those things with static but not dynamic memory? Seems unrelated to me.

How one uses memory is a different issue.

 

Using stack memory as much as possible is for sure desired. I mentioned the upper as the dynamic memory usage, when it is not safe to create an instance on the stack anymore.

One should then declare and instantiate up front as much as possible, and have runtime created objects to come really rare. Not only becouse of the error security, but becouse of many other benefits.




#5200304 Should I use std::cout or have using namespace std; ?

Posted by JohnnyCode on 27 December 2014 - 02:45 PM

Not applying using namespace has severall advantages

1- instant readiblity of code

2- great auto-finish comfort

3- library/modules tracking

4- lesser compile time duties

 

and the only disadvantage

 

5- you have to type more

 

but the disadvantage is greatly negated by auto-finish higher comfort. If you happen to be leaning towards using "using", like if you are aware of 9 mentions of the namespace incoming (rare situation), you still should avoid it, but that is just my personal rule I apply to myself.




#5199690 Problem with tangents (fbx)

Posted by JohnnyCode on 23 December 2014 - 06:47 AM

are you sure the tangents are correct ?

because on top of the head there is this weird area.

That is the seem, they appear where inconsistent mapping happens.  it still can appear in your spectating shader, but should not affect lightning if you use correct handedness of tangent. Stop doubting maya generated tangents finaly




#5199601 What to do after the basics

Posted by JohnnyCode on 22 December 2014 - 04:49 PM

 

Make something.

Or make a piece of something.

 

Learning how to make steps that do not fade in vain from point of knowledge is the basics




#5199599 Problem with tangents (fbx)

Posted by JohnnyCode on 22 December 2014 - 04:41 PM

Remeber there are two types of binormals, the one that is truly orthogonal to tangent/ and the one that is cross porduct of the very tangent and of the smoothed normal. The second is wanted , so compute it yourself, and do not pick it from asset defintion, as the asset usualy delivers the real bitangent (the truly orthogonal one- not desired for lightining)




#5199589 Problem with tangents (fbx)

Posted by JohnnyCode on 22 December 2014 - 04:13 PM

bitangents seems incorrect (they should be smooth). Normals are definetly correct, compute the bitangent as the smoothed normal and tangent cross product and display them- if they show smooth, you are all set. And should nat pay attention to tangent vectors not being smooth at all (they never are)




#5199549 Easiest coding language?

Posted by JohnnyCode on 22 December 2014 - 11:46 AM

There are two types of languages from point of develpoment influence on memory, the memory safe (C#, Java, VB.), and then the memory unsafe (c++, pascal, c...)  . If you are a beginner, it still hard to advice what to pick to learn about machine code and obstacles it bring in program runtime. With memory unsafe language, you will learn quite totally what software on computer is and gain experience needed, but if you attempt to do a larger project in memory unsafe language, you may end up giving up the production of the program!

 

What I would recommend is to learn memory unsafe language, and then move into memory safe language when you get to point of creating a serrious product (I highly recommend to pick memory safe language for production)




#5199542 Problem with tangents (fbx)

Posted by JohnnyCode on 22 December 2014 - 11:15 AM

 

using tangents/bitangents generated by maya

What are you displaying? Tangents, or normals? You should compute binormal as cross porduct of tangent and smooth normal, then display to yorself smooth normals and binormals, those should be smooth, tangents are never smooth. Tangent are equal for all three verticies and are of very triangle plane contained.




#5197006 Opengl and 8bit indexed textures color[256][3],colorindex[256]

Posted by JohnnyCode on 08 December 2014 - 12:37 PM

Most standard aproach is to have an entire animation texture, for example of resolution 2042*2042 and have 256*256 or 128*128 atlased frames in it. It is up to shader to pick and rasterize desired one, through uniform shader value being issued.  If you want to save memory, you can use 16 bit RGB texture format in ogl texture creation (glTexImage2D), though 8 bit pallete textures are not provided. You can create this 16bit RGB texture from any RGB source image (24bit true color jpeg or png or whatever), this would allow you to upload to GPU twice more textures, since aproach of animating by texture frames is expensive over that.

 

In case you would really wish to use 8bit textures, what might be sufficient for your production, then you will need to create a (partialy) custom asset, a png image that carries in its 4 channels for sepparate textures. Then load it standardly as a RGBA texture of 8 bits per channel and use that in shaders. This would be most resources saving, but it would complicate the production, since you would have to create this custom 4 channel 32 bit image from your four 256 color textures - in a custom way.




#5195624 Render part of texture with shader

Posted by JohnnyCode on 30 November 2014 - 10:32 PM

A texture, out of its dimension (weheather 256*1024) is always being 1.0*1.0. Strange yet absolute. You should always happen to have your texture to be square, and those squares being a power of two (256/512/1024/2048), but may it be any value, height and width is always reflected agains 1.0/1.0 value, so make it reflect towards thoes, as you try to map those taxtures onto. And if you have an arbitrary picture remaping, compute it towards 1.0/1.0 coordinae of sample , derived from arbitrary map space of texture




#5194298 introducing myself, guidance requested

Posted by JohnnyCode on 23 November 2014 - 12:41 PM

 

I draw, I make music, I write sometimes and now I have also learnt some coding also (essential Python and some C)

Since you mention C in stead of C++ you have a good programming background/teacher, follow it.

 

I would like to stress, that in my opinion, you should remain productive especialy in the area you have mentioned, but gaining trivial knowledge of coding would benefit you some, but further knowledge of obstacles and trials of coding, would too, even without your ownself implementing them.

 

Read and study every topic here on gamedev, as it will enrichen you in procedural defintion area of code runtime behavior (some will not as soon as you think).

 

But if you remain productive in what you mentioned , namely drawing and possibly music, you can escalate and create a lot, becouse coding is nothing but learning a few rules of code, leaning towards compute munching machine preferances.

 

Here is a little speed up, that fall and stands on 2d art (2d art is vitaly important in 3d as well, mind that, it creates actual visualization, wheather data is color, or light aproximation)

 

samorost 1

 

http://amanita-design.net/samorost-1/

 

samorost 2

 

http://amanita-design.net/samorost-1/

 

If you have talent in drawing, feed that, there is no problem though in discovering what technology can simulate of course

 

 




#5190394 Normal map artifact still here.

Posted by JohnnyCode on 31 October 2014 - 09:14 AM

 

I've made simple terrain normals into texture rendering function(without tanget and bitangent calculations). And picture had became good.

So you are using object space normals. With those you do not have this artifact, but if you interpolate light direction vector in pixel shader, you do.

It is a known problem of that direction vectors do not linearily interpolate good on a triangle (on edges only 2 verticies donate interpolation, what can issue in a too big jump if third interpolator was away from zero attribute). But position vectors interpolate good.  So if you will compute light vector in pixel function from interpolated object space position and object space light position, your artefact should dissappear.




#5190338 Efficient array shuffing in pure HLSL

Posted by JohnnyCode on 31 October 2014 - 06:28 AM


 

Actually I pixelate ("downsample" in some sense) the screen to some extend, say 48 x 48 blocks. Would you then still suggest going the way of goniometric functions, or is there a simpler approach?

You can scale the goniometric function and noise multiplicator the way it suites you to noise your area. In case of noising 1000x1000 screen it would quite do some job. I was understanding that you index [x,y] pixel to a [i] where every i differs for [x,y] unique vector. In case you run a 2d function instead, it is just even more suitable solution.

 

And if some very reasonable other suggestions here, are not possible for you to perform , you should politely state so.






PARTNERS